identifiers, keywords, commentsFirst, identifiers
The names of packages, classes, methods, parameters, and variables in Java consist of any order of size letters, numbers, underscores (_), and dollar signs ($).
Identifier: Cannot start with a number and cannot be a reserved keyword in Java
such as: Yourname, Yourname_dxh, Li_yourname, $yourname are legal identifiers
Class, 67.9,hello World is not legal, class is the keyword, 67.9 starts with a number, there is a space in the middle of Hello world
Second, the key word
Keywords in Java
Abstract |
Boolean |
Break |
Byte |
Case |
Catch |
Char |
Class |
Continue |
Default |
Do |
Double |
Else |
Extends |
False |
Final |
Finally |
Float |
For |
If |
Implements |
Import |
instanceof |
Int |
Interface |
Long |
Native |
New |
Null |
Package |
Private |
Protected |
Public |
Return |
Short |
Static |
Synchronized |
Super |
This |
Throw |
Throws |
Transient |
True |
Try |
void |
Volatile |
While |
Assert |
Enum |
Third, comments
// represents a single-line comment, where the comment is in the comment line, preceded by a double slash (//) before the content needs to be commented
/* * Multiline comment, beginning with a single slash plus a Star (/*), ending with a single slash (*/) in the star */
/** * Document Comments * Preceded by a single slash plus two star marks (/**), with a star marker and a slash (*/) End * The content of this method annotation will be interpreted as the official document of the program, And can be included ina document generated by tools such as: Javadoc * * *
Java learns from zero (identifiers and keywords)