3.8 Identifiers
An identifier is an unlimited-length sequence of Java letters and Java digits, the
first of which must be a Java letter. An identifier cannot have the same spelling
(Unicode character sequence) as a keyword (§3.9), boolean literal (§3.10.3), or the null literal (§3.10.7).
A “Java letter” is a character for which the method Character.isJavaIden
tifierStart(int) returns true. A “Java letter-or-digit” is a character for which
the method Character.isJavaIdentifierPart(int) returns true.
The Java letters include uppercase and lowercase ASCII Latin letters A–Z
(\u0041–\u005a), and a–z (\u0061–\u007a), and, for historical reasons, the
ASCII underscore (_, or \u005f) and dollar sign ($, or \u0024). The $ character
should be used only in mechanically generated source code or, rarely, to access pre-existing names on legacy systems.
The “Java digits” include the ASCII digits 0-9 (\u0030–\u0039).
Two identifiers are the same only if they are identical, that is, have the same
Unicode character for each letter or digit.
Examples of identifiers are:
String i3 αρετη MAX_VALUE isLetterOrDigit
No comments:
Post a Comment