Java Reserved Keywords
Java has a set of keywords that are reserved words that cannot be used as
variables, methods, classes, or any other identifiers:
Keyword Description
abstract A non-access modifier. Used for classes and methods: An abstr
objects (to access it, it must be inherited from another class).
an abstract class, and it does not have a body. The body is pro
assert For debugging
boolean A data type that can only store true or false values
break Breaks out of a loop or a switch block
byte A data type that can store whole numbers from -128 and 127
case Marks a block of code in switch statements
catch Catches exceptions generated by try statements
char A data type that is used to store a single character
class Defines a class
continue Continues to the next iteration of a loop
const Defines a constant. Not in use - use final instead
default Specifies the default block of code in a switch statement
do Used together with while to create a do-while loop
double A data type that can store fractional numbers from 1.7e−308 t
else Used in conditional statements
enum Declares an enumerated (unchangeable) type
exports Exports a package with a module. New in Java 9
extends Extends a class (indicates that a class is inherited from anothe
final A non-access modifier used for classes, attributes and method
(impossible to inherit or override)
finally Used with exceptions, a block of code that will be executed no
float A data type that can store fractional numbers from 3.4e−038 t
for Create a for loop