Enum Enum class
1.values ()
Description: The values () method returns a collection of enumeration classes that do not exist in the Enum class and are added by the compiler dynamically.
2.valueOf ()
Description: valueof () returns an object of the specified name in the enumeration class, case-sensitive.
Enumnametest.valueof ("READ"). CompareTo (Enumnametest.read) will return 0
3.compareTo ()
Description: Compares two enumerated objects is not the same, returns the same 0, not the same return-1
Enumnametest.valueof ("READ"). CompareTo (Enumnametest.write) will return-1
4.getDeclaringClass ()
Description: Returns the class object for this enumeration constant, enum type
5.ordinal ()
Description: Returns the position of this enumeration type, in order
Public enum enumnametest {
read,write
}
EnumNameTest.READ.ordinal () will return 0
EnumNameTest.WRITE.ordinal () will return 1