Java 编码规Java 编码规 11.说明 31.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 (condition) {6} else if (condition) {77.5 for 语句(for Statements)77.6 while 语句(while Statements)77.7 do-while 语句(do-while Statements)77.8 switch 语句(switch Statements)77.9 try-catch 语句(try-catch Statements)7} catch (ExceptionClass e) {7} catch (ExceptionClass e) {7} finally {78. 空白(White Space)78.1 空行(Blank Lines)78.2 空格(Blank Spaces)79. 命名规(Naming Convention)810. 编程惯例(Programming Practices)810.1 提供对实例以与类变量的访问控制(Providing Access to Instance and Class Variables)810.2 引用类变量和类方法(Referring to Class Variables and Methods)810.4 变量赋值(Variable Assignments)810.5 其它惯例(Miscellaneous Practices)9圆括号(Parentheses)9返回值(Returning Values)9条件运算符“?〞前的表达式(Expressions before “?〞 in the Conditional Operator)9特别注释(Special Comments)911. 代码例(Code Examples)911.1 Java 源文件例(Java Source File Example)91.说明1.1 为什么要有编码规编码规对于程序员而言尤为重要,有以下几个原因:◆一个软件的生命...