22,2.2 identifier

    Identifier is used to variables, classes, methods, and naming package, such as welcome, main, System, age, name, gender and the like. Logo clothing need to comply with certain rules:

 

1, the identifier must (_), dollar sign ($) begin with a letter, underscore;

2, the identifier may be other portions of letters, underline, dollar sign and any combination of numbers;

3, Java identifier is case-sensitive, and unlimited length;

4, the identifier can not be a Java keyword.

 

Use identifier:

1, represents the class name identifier: each capitalized, such as Man, GoodMan;

2, represents the identifier variables and methods: the first word lowercase, beginning from the second word capitalized, which we call "hump rules", such as eat (), eatFood ().

 

[Note]: Java is not used ASCⅡ character sets commonly used language, instead of using the Unicode character set, so here meaning not just the English alphabet, also including Chinese characters, etc., but does not recommend the use of Chinese characters is defined identifier.

Guess you like

Origin www.cnblogs.com/zglbt/p/11331235.html