2014-03-03

All Java8 keywords vs literals


These are the 50 Java keywords that are not allowed to be used as identifiers:
abstract, continue, for, new, switch,
assert, default, if, package, synchronized,
boolean, do, goto, private, this,
break, double, implements, protected, throw,
byte, else, import, public, throws,
case, enum, instanceof, return, transient,
catch, extends, int, short, try,
char, final, interface, static, void,
class, finally, long, strictfp, volatile,
const, float, native, super, while

The const and goto keywords are reserved and not currently used.

You might wonder why null, true, and false have not been mentioned in the list. Those are literals and no keywords. Literals are also in-source values like "this is a string" (String literal) or numbers like "1.234_456d" (double literal).