Friday 2 May 2014

Java.lang.Enum class

All enums implicitly extend java.lang.Enum. Enum class provides methods like to get the position of enum constant, to compare enum constants etc.,


compareTo : Compare two enum constants
equals : Check for equality
getDeclaringClass : get the enum constant Enum type
name : Get the name Of enum constant
ordinal : Get the Position of enum constant
toString: Return Name of enum constant

valueOf: Returns the enum constant of the specified enum type with the specified name.


Prevoius                                                 Next                                                 Home

No comments:

Post a Comment