Identifiers and variables are among the most often used elements of Java. They are closely coupled because every variable has a name and the name of a variable is an identifier.
Identifiers and variables
Identifier
An identifier is the first in the list of Java tokens. It is a sequence of symbols, each may be a letter, a dollar sign $, an underscore, _, or any digit 0-9. The restrictions are as follows:
- The first symbol of an identifier cannot be a digit
- A single-symbol identifier cannot be an underscore _
- An identifier cannot have the same spelling as a keyword (see the Reserved and restricted keywords section)
- An identifier cannot be a Boolean literal true or false
- An identifier cannot be spelled as a special type null...