Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Programming \ Java coding conventions     - Security Configuration SQL Server 2000 database tutorial (Linux)

- Linux learning portal: CentOS 6.4 system kernel upgrade (Linux)

- Automated Password Generator: Linux under a special password generator (Linux)

- MongoDB 2.6 deployment replica set + partitions (Database)

- Python in yield (Programming)

- Linux program analysis tool: ldd and nm (Linux)

- Oracle 11g can not export a variety of empty table solution (Database)

- VPS xen openvz kvm (Server)

- Swift defined type conversion and type aliases (typealias) (Programming)

- MySQL common functions summary (Database)

- MySQL database to open a remote connection method (Database)

- Creating and extracting archives 11 tar command examples in Linux (Linux)

- Java polymorphism and exception handling (Programming)

- MyEclipse configuration necessary (Linux)

- IBM Data Studio to use ---- window displays all rows (Database)

- 30 minutes with your Quick Start MySQL Tutorial (Database)

- Configuring Sublime Text Python runtime environment 2 (Linux)

- Implement Oracle dynamic registration of non-standard port 1521 (Database)

- C ++ Supplements - Virtual Function Principle (Programming)

- MyCAT read and write separation of MySQL (Database)

  Java coding conventions
  Add Date : 2018-11-21      
  Good code than lengthy documents.

1. File Encoding
Source file encoding format is UTF-8.

2. The package name in lowercase letters

3. import Do not use wildcards
That is, do not appear like this import statement: import java.util *;.

4. The column length limit
A project can select a row or column 80 character limit of 100 characters, the column length limit is exceeded wrap, for at least four rows indented spaces to indent Do not use tab.

5. Notes
Comments should be concise, critical of the code should have annotations, which can not mislead the reader.

6. The variable declaration
A time to declare a variable, do not use a combination of statements, such as int a, b;
We need only declare a variable, and initializes as soon as possible.

7. Naming Convention
Naming should: See the name to know Italy, concise, avoid spelling and English mix.
Naming Style:
Class names are written in the style UpperCamelCase
Const field names, method names, parameter names, local variable names to write lowerCamelCase style
Constant names are written in the style CONSTANT_CASE

8. The order of class members
Each class should be some logic to sort its members, defenders should be able to explain the logic of this sort. For example, the new method does not habitually added to the end of the class.

9. caution System.out.println ()
Use log rather than System.out.println ()

10. Use braces (even optional)
Braces and if, else, for, do, while statements used together, even if only one statement (or empty) should also be written on the braces.

11. reduce code nesting
When the code is nested hierarchy of three or more layers, the average person will be difficult to understand.
There are many ways to reduce nesting: (1) The terms of the merger; (2) use to return later omitted else; (3) the use of sub-method

12. Exception Handling
Caught exception can not be ignored, the typical response mode is to print the log
- A simple shell script for monitoring in Linux (Linux)
- How to use the Linux kill command to kill the process / program is not responding (Linux)
- Iscsi package is installed on RHEL 6.3 x86-64 systems (Linux)
- STL in the list of erase () method (Programming)
- pureftpd basis: Install, configure, implement, anonymous logon (Linux)
- Several Methods of SSH Auto - login (Linux)
- ElasticSearch basic usage and cluster structures (Server)
- Python interview must look at 15 questions (Programming)
- VSFTPD Security (Linux)
- How Mutt mail client to use cipher text password (Linux)
- Realize screen recording and playback via Linux command (Linux)
- JavaScript common array manipulation functions and usage (Programming)
- Logging information through the web GUI (LogAnalyzer) (Server)
- 17 How to install the Ubuntu 14.04 and Linux Mint Kodi14 (XBMC) (Linux)
- Ubuntu under Spark development environment to build (Server)
- To protect the temporary files for Linux security (Linux)
- mydumper installation error process (Database)
- System Security: Build Linux with LIDS steel castle (Linux)
- Oracle11g Trigger Debugging Record Error: PLS-00201: identifier SYS.DBMS_SYSTEM 'must be declared (Database)
- Vi (Vim) keyboard map and its basic commands (Linux)
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.