I have read the question Difference of Enum between java and C++? but I\'m still confused.
I would like the following to return the related String:
p
If the pattern holds, this works as well and eliminates the repetition:
public enum Checker { EMPTY, RED, YELLOW; public String getDescription(){ String name = name(); return ""+Character.toUpperCase(name.charAt(0)) +name.substring(1).toLowerCase(); } }