The following character sequences, formed from ASCII letters, are reserved for use as keywords and cannot be used as identifiers (§3.8):
Keyword: one of
abstract default if private throw
boolean do implements protected throws
break double import public transient
byte else instanceof return try
case extends int short void
catch final interface static volatile
char finally long super while
class float native switch
const for new synchronized
continue goto package this
The keywords const
and goto
are reserved by Java, even though they are not currently used in Java. This may allow a Java compiler to produce better error messages if these C++ keywords incorrectly appear in Java programs.
While true
and false
might appear to be keywords, they are technically Boolean literals (§3.10.3). Similarly, while null
might appear to be a keyword, it is technically the null literal (§3.10.7).