3.
Identifiers in Java
An identifier is the name you assign to elements in your program such as variables,
methods, classes, or other user-defined components. These names are used to
identify and refer these elements within the code. However, there are certain rules
that are strictly enforced by the Java compiler when naming identifiers.
Starting character — An identifier must begin with a letter (A–Z or a–z), an
underscore (_), or a dollar sign ($). It cannot begin with a digit (0–9).
Reserved Literals in Java
In addition to the keywords, Java also reserves three literal values: true, false,
and null. These are not keywords, but they are reserved words in the language.
true and false are the only boolean values in Java.
null represents the null reference, meaning an object that does not point to any
memory location.
Although they are not classified as keywords in the Java Language Specification,
they cannot be used as identifiers for variables, methods, classes, or any other
user-defined elements. These reserved literals have been part of Java since its
beginning.