Monday, September 13, 2010

Java Enum

To iterate on enum to get all its values

for (NotifyTypeEnum notifyTypeEnum : NotifyTypeEnum.values()) {
notifyType.addItem(notifyTypeEnum.toString());
}


To convert a string to Enum type, use "valueOf" method

No comments:

Post a Comment