[Note] C # basic introduction -- C # naming rules for identifiers,
The variable name, constant name, class name, and method name in the program are calledIdentifier. C # There is a set of naming rules for Identifiers. If the naming rules are not followed, an error will occur. The rules are described as follows:
① An identifier can only consist of letters, numbers, and underscores. It cannot contain spaces or other characters.
Incorrect identifier declaration:
String $ user; // other characters are used when an error occurs.
② The variable name cannot start with a number.
Incorrect identifier declaration:
Double 6 h; // The error code starts with a number.
③ Keywords cannot be used as variable names.
Incorrect identifier declaration:
Char static; // an error occurs when the keyword static is used as the variable name.
The above is taken from MOOC course C # getting started with development