Class name convention in java

ankit picture ankit · May 14, 2013 · Viewed 43.6k times · Source

What is the naming convention of classes in java, for example should all classes be in upper case like MYCLASS.java ?

as some classes like com.sun.org.apache.bcel.internal.generic. ANEWARRAY. can be found in Sun's library as well

Note: I have read all naming convention from Oracle but I could not find anything which says we should name a class with All Uppercase.

Answer

CloudyMarble picture CloudyMarble · May 14, 2013

Class Names should be in CamelCase. Try to use nouns because a class is normally representing something in the real world.

The Documentation states the following:

Class names should be nouns, in mixed case with the first letter of each internal word capitalized. Try to keep your class names simple and descriptive. Use whole words-avoid acronyms and abbreviations (unless the abbreviation is much more widely used than the long form, such as URL or HTML).