The language features of a Java program consist primarily of identifiers, keywords, and annotations.
First, identifiers
An identifier is actually a name used to identify the classes, objects, variables, methods, interfaces, arrays, files, and so on that are frequently used in the program. Identifiers can be freely defined by the user themselves as needed, but the rules must be met:
(1) Identifiers are composed of letters, numbers, underscores _, and dollar sign $.
(2) Identifiers can only be started by letter, underscore _, dollar sign $.
(3) Java identifiers are case-sensitive, and name and name represent different identifiers, respectively.
(4) Identifiers do not have a length limit, as long as the memory capacity can be satisfied, can take any length of the name.
(5) in the name of the identifier is generally used to represent its meaning in English, so that others can read the meaning of the expression.
(6) Keywords and reserved words cannot be identified as identifiers.
Second, the key word
Some strings with specific meanings are predefined in the Java language, called keywords or reserved words. Keywords in the Java language are represented by lowercase letters. There are currently 50 keywords in the Java language, where const and common goto are two keywords that are currently reserved but not yet used, and do not have a specific meaning.
Java Keywords
Abstract |
Catch |
Else |
Goto |
Long |
Return |
This |
While |
Assert |
Char |
Extends |
If |
Native |
Strictfp |
Throw |
|
Byte |
Class |
Enum |
Implements |
New |
Short |
Throws |
|
Boolean |
Continue |
Finul |
Import |
Package |
Static |
Transient |
|
Break |
Default |
Finally |
instanceof |
Private |
Super |
Try |
|
Case |
Do |
Float |
Int |
Protected |
Switch |
void |
|
Const |
Double |
For |
Interface |
Public |
Synchronzized |
Volatile |
|
Java Identifiers and keywords