keywords, identifiers, comments, constants
1. Key words
The Java language has a specific meaning of the word, the letters are all lowercase, such as: class, public, static, void ...
2. Identifiers
Names of interfaces, classes, methods, variables, such as Fin, main ...
Composition rules: English letters, Numbers, $, _ ...
Note: Cannot start with a number, cannot use keywords, English letters are case-sensitive
Naming rules: Package: Lowercase letters, multi-level package between the subordinate ".", such as: Liverpool (single-stage package), Liverpool.gerrard (multi-level package) ...
Interface: Uppercase "I" with the first letter of each word capitalized, such as: Ifin, Iliverpoolgerrard ...
Class: Capitalize the first letter of each word, such as: Fin, Liverpoolgerrard ...
Method: First letter lowercase, the remaining words capitalized, such as: Main, Liverpoolgerrard ...
Variables: First letter lowercase, the remaining words capitalized, such as: Liverpool, Liverpoolgerrard ...
Constants: All letters are capitalized, and words are separated by "_", such as: LIVERPOOL, Liverpool_gerrard ...
3. Comments
Single-line Comment://
Multiline Comment:/* ... */
Documentation Notes:/** ... */
4. Constants
The amount of value does not change during program execution.
String constants: "Liverpool"
Character constant: ' n '
Integer constants: 1892
Decimal constants: 3.14
Boolean constant: True, False
NULL constant: null
Older Dick Silk Self-study note--java 0 basics to rookie--005