Objective
This document is a complete definition of the Google Java Programming style specification. When and only if a Java source file conforms to the rules in this document, we think it conforms to Google's Java programming style.
As with other programming style guides, this is not just about the beauty of the coding format, but also about conventions and coding standards. However, this document focuses primarily on the rules that we generally follow, and we try to avoid providing advice to those who are not explicitly obligated to do so.
Terminology Description
In this document, unless otherwise noted:
- The term class can represent an ordinary class, an enumeration class, an interface, or a annotation type (
@interface
).
- The term comment is used only to refer to the implementation of annotations (Implementation comments), we do not use the word "documentation comments", but rather javadoc.
- Other term descriptions will occasionally appear in subsequent documents.
Guide Description
The sample code in this document is not a specification. That said, while the sample code follows Google's programming style, it doesn't mean that this is the only way to show the code. The format selection in the example should not be enforced as a rule.
source file base source file structure format naming convention Programming practice Javadoc PostScript
Google Java Programming Style guide