Duplicate :
|
The compiler-generated code for the static method valueOf(String) in every enum type scans the list of enumeration constants linearly. Correct but not very efficient. Better would be to delegate to Enum.valueOf(Class,String), which uses a Map maintained in the class object.
|