Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
W
wiki-java
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • 老徐
  • wiki-java
  • Wiki
  • java code specification

java code specification · Changes

Page history
ulindows deleted page: JavaCodeSpecification authored Jun 13, 2016 by 老徐's avatar 老徐
Show whitespace changes
Inline Side-by-side
Showing with 27 additions and 0 deletions
+27 -0
  • java-code-specification.md java-code-specification.md +27 -0
  • No files found.
java-code-specification.md
View page @ f63d7a07
......@@ -204,6 +204,33 @@ a * b;
### 5 命名规范
#### 5.1 命名基本规范
  命名应该遵守以下基本原则:
* **1. 命名要简单清楚,避免使用引起误解的词汇,避免使用模糊的缩写,长度不要超过25个字符**
* **2. 命名必须使用英文单词,不能使用汉语拼音**
* **3. 命名用可发音的名字**
* **4. 选择通用词汇并且贯穿始终**
* **5. 命名要通俗易懂**
  另外,命名还应该做到:
* **1. Package 的名字应该都是由一个全部小写单词组成。**
* **2. Class 的名字必须由大写字母开头而其他字母都小写的单词组成**
* **3. 变量的名字必须用一个全部小写的单词开头。后面的单词用大写字母开头,其余都小写。**
* **4. 参数的名字必须和变量的命名规范一致。**
* **5. 数组应该总是用下面的方式来命名:**
```
byte[] buffer;
```
  而不是:
```
byte buffer[];
```
* **6. 使用有意义的参数命名,如果可能的话,使用和要赋值的字段一样的名字:**
```
setCounter(int count)
{
this. count = count;
}
```
#### 5.2 类名采用每个单词首字母大写的方式
#### 5.3 包的命名格式采用utn.xxx开头
#### 5.4 常量、静态变量名采用全大写的方式,每个单词间用下划线分隔
......
Clone repository
  • git configuration and simple use
  • Home
  • java code specification
  • maven environment configuration
  • shuidi js develope
  • ucs_project environment configuration