I have an enum type…
public static enum Methods {
NOTEQUAL,
ORDERED,
minMatch,
minItem,
minLength,
sameLength,
}
The question is how should I use the coding convention. Should I use camelCase NotEqual (wich I use in a simple class) or should I do like this: NOT_EQUAL? Or simply use uppercase characters: NOTEQUAL, SAMELENGTH?
Is there some code convention for this?
I would say that the enum itself, since it’s a class, should follow the camel case convention as every class, while the entries of enum, since they are constants, should be upper case with underscore (eg.
NOT_EQUAL).The version uppercase without underscore is absolutely unreadable, never use it.