Coding Standards

For the Java Language

In addition to Oracle, a lot of organizations have published their own standards for Java code:

Google's comprehensive set of standards

This is Google's  "complete definition of Google's coding standards for source code in the Java™ Programming Language."

Oracle's Secure Coding Guidelines for Java SE

This overlaps with some of the CERT material mentioned below. Updated for Java SE 8, the main thrust of the guidelines are that, although Java is a fairly secure language in that it eliminates such things as buffer overflow problems, it is still easy to write unsecure code.

The CERT Oracle Secure Coding Standard for Java

This includes rules and recommended practices for secure programming for Java. Although it specifically mentions the Standard Edition 6 and Java SE 7 versions (as of the Feb 11, 2014 edition) most (if not all) of the advice will be applicable to any version of the language.

AmbySoft Java coding standards

As well as specifying formats for code layout, this document also includes some very good advice on how to write comments in your code.

Sun's original Java Coding Standards from 1998

Interesting to see how little has changed.

Previous ...back to the standards overview