Wednesday, January 27, 2010

enum != Enum

All enumerations automatically contain two predefined methods: values( ) and valueOf( ).

1. public static enum-type[ ] values( )
2. public static enum-type valueOf(String str)

These two methods are not in Enum API.


enum Week {
Monday, Tuesday, Wednesday, Thursday, Friday, Saturaday, Sunday
}

Week allWeek[] = Week.values();

No comments: