As already stated, enum instances should be uppercase according to the docs on the Oracle website (http://docs.oracle.com/javase/tutorial/java/javaOO/enum.html).
However, while looking through a JavaEE7 tutorial on the Oracle website (http://www.oracle.com/technetwork/java/javaee/downloads/index.html), I stumbled across the "Duke's bookstore" tutorial and in a class (tutorial\examples\case-studies\dukes-bookstore\src\main\java\javaeetutorial\dukesbookstore\components\AreaComponent.java
), I found the following enum definition:
private enum PropertyKeys {
alt, coords, shape, targetImage;
}
According to the conventions, it should have looked like:
public enum PropertyKeys {
ALT("alt"), COORDS("coords"), SHAPE("shape"), TARGET_IMAGE("targetImage");
private final String val;
private PropertyKeys(String val) {
this.val = val;
}
@Override
public String toString() {
return val;
}
}
So it seems even the guys at Oracle sometimes trade convention with convenience.