Java BASICS (1. Identifiers), java identifiers
1. Identifiers: identifier
Names of class, method and variable are used for class name, method name, variable name
Begin with character, '_' or '$' the identifier cannot start with a number.
Case sensitive
No length limitation unlimited length
The identifier cannot be a java keyword, or a Chinese character can also be used as an identifier. It is not recommended at the time (involving encoding and cross-platform issues)
String is a java class. The class name can be used as an identifier.
In Java, sizeof is not an operator and can be used as an identifier.
Keywords and reserved words (const, goto, true, false, null) cannot be used as identifiers.
Public class Identifiers {public static void main (String [] args) {String $ abc = "abc1"; String _ abc = "abc2"; // compilation error, the identifier cannot start with a number // String 8abc = "abc3"; String China = "China"; String = "jaya"; int Integer = 22; // There is no sizeof operator in Java, so sizeof can be used as the identifier String sizeof = "sizeof"; System. out. println (String); // jaya System. out. println (Integer); // 22 }}