Appendix B. Reserved Words

Reserved words are part of the Java language syntax. They cannot be used as names for variables, methods, classes, interfaces, packages, or labels. Table B.1 lists Java's 52 reserved words.

Table B.1. Reserved Words

abstract assert boolean break byte
case catch char class const
continue default do double else
extends false final finally float
for goto if implements import
instanceof int interface long native
new null package private protected
public return short static strictfp
super switch synchronized this throw
throws transient true try void
volatile while    

Java does not currently implement const and goto. Furthermore, except for false, null, and true, all reserved words are also known as keywords. (false, null, and ...

Get Java™ 2 by Example, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.