summary:
1, JAVA program in the comment concept : is to make the program better able to understand, explain and explain to add!
- Single-line comments: // representation
- Multi-line comments: / ** * Content / shortcut keys: Ctrl + Shift + /
2, keyword : JAVA which has been pre-defined a special English words,
比如:public、static、class、void
3, the identifier : Some English words define our own mark. For example, the name of our HelloWorld applet
4, naming and naming conventions
- Hard requirement: as far as possible to begin with letters (26 letters of the alphabet can be), may comprise from 0 to 9, $, _
- Identifier can not begin (custom) digitally.
- Identifier can not be a keyword.
- Extracurricular added:
variable name only alphanumeric $ _
variable is the first character only letters $ _
variable first character can not use digital
- Soft suggestion: follow the hump logo
- The first letter of the first name of the class as much as possible should be capitalized, the next encounter a new word must be capitalized (big camel).
- The method name in lowercase, then encounter a new word must be capitalized (small camel).
- Variables also to the first letter lowercase, then encounter a new word must be capitalized (small camel).
Easy to understand:
public class HelloWorld(类名称){
public static void main(方法名称)(String[] args){
int i(变量名称)=5;
System.out.println("java,你好!");
}
}
5, pay attention
- $ Is java bytecode compiler to create a character internal use, it is recommended not to use in the source program