[java] Java naming convention for static final variables

Well that's a very interesting question. I would divide the two constants in your question according to their type. int MAX_COUNT is a constant of primitive type while Logger log is a non-primitive type.

When we are making use of a constant of a primitive types, we are mutating the constant only once in our code public static final in MAX_COUNT = 10 and we are just accessing the value of the constant elsewhere for(int i = 0; i<MAX_COUNT; i++). This is the reason we are comfortable with using this convention.

While in the case of non-primitive types, although, we initialize the constant in only one place private static final Logger log = Logger.getLogger(MyClass.class);, we are expected to mutate or call a method on this constant elsewhere log.debug("Problem"). We guys don't like to put a dot operator after the capital characters. After all we have to put a function name after the dot operator which is surely going to be a camel-case name. That's why LOG.debug("Problem") would look awkward.

Same is the case with String types. We are usually not mutating or calling a method on a String constant in our code and that's why we use the capital naming convention for a String type object.