Java 编码规Java 编码规 11
1 为什么要有编码规 31
2 声明 32
文件名(File Names)32
1 文件后缀(File Suffixes)33
1 Java 源文件(Java Source Files)3开头注释(Beginning Comments)3包和引入(Package and Import Statements)3类和接口声明(Class and Interface Declarations)34
1 行长度 34
2 换行(Wrapping Lines)3// CONVENTION INDENTATION4Object andStillAnother) {4||
(condition5 && condition6)) {45
注释(Comments)45
1 实现注释的格式(Implementation Comment Formats)4块注释 4单行注释(Single-Line Comments)5尾端注释(Trailing Comments)5行末注释(End-Of-Line Comments)55
2 文档注释(Documentation Comments)56
声明(Declaration)56
1 每行声明变量的数量(Number Per Line)56
2 初始化(Initialization)66
3 布局(Placement)67
1 简单语句(Single Statement)67
2 复合语句(Compound Statements)67
3 返回语句(return Statements)s67
4 if, if-else, if else-if else 语句(if, if-else, if else-if else Statements)6} else {6} else if (conditio