No official up-to-date Java language style guide is available from Oracle until now. The closest to this is a document from 1999 by Sun Microsystems, which is still archived on the Java website at the time of writing this. Some of its most important points, which are still relevant today, are:
- It is recommended that you start each file of a project with the same header comments that at least contain the class name and copyright information.
- The public class, or public interface, must be the first entry in the file. If the file has other classes or interfaces with other access modifiers, they need to be added below the public class or interface.
- This is the order we follow when defining a class or interface:
- Javadoc headers of the class or interface (this topic will be discussed in the next chapter).
- The class or interface keyword (including the access modifiers and...