Introduction
Every programming language has a set of reserved words or keywords with special meaning when used in a program code. Keywords define some internal process or pre-defined action when in use. Hence, keywords can not be used as names or identifiers for classes, objects, methods or variables. Doing so would result in a compilation error as the compiler understands the keyword as its pre-defined meaning.

You can also read about the topic of Java Destructor, Duck Number in Java
List of Java Keywords
Java, at present, uses 49 reserved words, excluding the goto and const keywords which are currently not in use. The list of keywords used in Java, along with their meaning and implementation are shown below.
Keyword | Description | Implementation and Use |
---|---|---|
abstract | A non-access modifier that is used on classes and methods to imply that it would be implemented later in the program. |
You can also try this code with Online Java Compiler |
assert | It describes a true-false statement to indicate that the user wants the result to be true. |
You can also try this code with Online Java Compiler |
boolean | A primitive data type that declares a variable to hold two values - true and false |
You can also try this code with Online Java Compiler |
break | A control statement used to break out of loops and switch case blocks. |
You can also try this code with Online Java Compiler |
byte | It is a signed 8-bit primitive data type in Java. Range: -128 to 127 |
You can also try this code with Online Java Compiler |
char | A primitive data type that is used to declare a character variable. |
You can also try this code with Online Java Compiler |
case | This is used in switch-case statements to execute blocks of code based on specific events/conditions. |
You can also try this code with Online Java Compiler |
catch | It is used to catch the exceptions generated by try statements. |
You can also try this code with Online Java Compiler |
class | To define and declare a class in Java. |
You can also try this code with Online Java Compiler |
continue | A control statement that is used to skip the current iteration and continue to the next. |
You can also try this code with Online Java Compiler |
default |
|
You can also try this code with Online Java Compiler |
do | It is used to start a do-while loop. |
You can also try this code with Online Java Compiler |
double | A primitive data type that declares variables to store 64-bit floating point numbers. |
You can also try this code with Online Java Compiler |
else | It is used to declare an alternate set of codes for an if statement. |
You can also try this code with Online Java Compiler |
enum | A keyword used to declare an enumerated data type that represents a group of constants. |
You can also try this code with Online Java Compiler |
extends | It is used to indicate that a class is derived from another class. |
You can also try this code with Online Java Compiler |
final | A non-access modifier which indicates that the contents of its variable, class or method is constant and final. |
You can also try this code with Online Java Compiler |
finally | It is used with try-catch statements to deal with exceptions. It holds the block of code that is executed irrespective of whether an exception exists or not. |
You can also try this code with Online Java Compiler |
float | A primitive data type that declares a variable to hold 32-bit floating-point numbers. |
You can also try this code with Online Java Compiler |
for | It is used to start a for loop. |
You can also try this code with Online Java Compiler |
if | It starts an if conditional statement. |
You can also try this code with Online Java Compiler |
implements | It indicates that the class implements an interface. |
You can also try this code with Online Java Compiler |
import | It is used to import a package or class. |
You can also try this code with Online Java Compiler |
instanceof | It is used to check whether an object is an instance of a specific class or if it implements an interface. |
You can also try this code with Online Java Compiler |
int | A primitive data type that can hold integers in the range -2147483648 to 2147483647 |
You can also try this code with Online Java Compiler |
interface | It is used to declare a class for only abstract methods. |
You can also try this code with Online Java Compiler |
long | A primitive data type capable of holding very large numbers. (64-bit integers) |
You can also try this code with Online Java Compiler |
native | It is used to indicate that the method is implemented in a language other than Java (native platform-specific code ) |
You can also try this code with Online Java Compiler |
new | It is used to create new objects of a class or an array. |
You can also try this code with Online Java Compiler
You can also try this code with Online Java Compiler |
package | To declare a new package. |
You can also try this code with Online Java Compiler |
private | An access modifier that allows access of its members only within the declared class. |
You can also try this code with Online Java Compiler |
protected | An access modifier that allows access of its members within the package and all of its subclasses. |
You can also try this code with Online Java Compiler |
public | An access modifier that allows access of its members to the entire Java universe. |
You can also try this code with Online Java Compiler |
return | It causes the control to return from a called method back to the calling method. |
You can also try this code with Online Java Compiler |
short | A data type that holds 16-bit integers. |
You can also try this code with Online Java Compiler |
static | A non-access modifier which indicates that it can be accessed without the creation of an object. |
You can also try this code with Online Java Compiler |
strictfp | It restricts the precision and truncation of floating-point calculations to ensure portability. |
You can also try this code with Online Java Compiler |
super | It is used to refer to the object of a parent class. |
You can also try this code with Online Java Compiler |
switch | It is used to create a multiway branch statement. |
You can also try this code with Online Java Compiler |
synchronised | A non-access modifier which tells that the critical sections of a multithreaded code should be executed one thread at a time. |
You can also try this code with Online Java Compiler |
this | It is used to reference the current object variable or method. this() can be used to invoke the current class constructor. |
You can also try this code with Online Java Compiler |
throw | It is used to throw a declared exception and create a custom error. |
You can also try this code with Online Java Compiler |
throws | throws is used to indicate the exception type that may be thrown by a method. |
You can also try this code with Online Java Compiler |
transient | A non-access modifier which specifies that an attribute is not part of an object's persistent state. |
|
try | It is used to start a try-catch block that handles exceptions. |
You can also try this code with Online Java Compiler |
void | It is used to declare that a method does not return any value. |
You can also try this code with Online Java Compiler |
volatile | Volatile specifies that a variable is asynchronously modified by concurrently running threads. |
You can also try this code with Online Java Compiler |
while | It is used to start a while loop. |
You can also try this code with Online Java Compiler |
You can practice on online Java Compiler.
Must Read What are Loops in Java.