×

Reserved Keywords in Java

In Java, a reserved term is used as a code key called a keyword. Because they are predefined, these terms cannot be used for anything else. They cannot serve as a name for a variable, an object, or any other type of identifier. In Java, there are 51 reserved phrases or keywords.

Java Reserved Keywords List

keywordDescription
Abstractsignifies that the class or method that comes after this keyword is abstract and must be implemented by a subclass.  
AssertDeclaring assertions or assumptions in a program is made easier by the assert keyword. If an assertion is true, the program continues normally; if not, an AssertionError is raised at runtime, and the program terminates.  
Booleandefines true and false as the two Boolean values 0 and 1.  
Breakused to escape loops or iterative structures.  
Bytecapable of storing 8-bit data as a data type.  
Casemarks sentences (cases) within a Switch statement.  
Catchused to handle exceptions thrown by the try block.  
CarUnsigned 16-bit Unicode characters can be stored in this data format.  
Classutilized to introduce a new class.  
ContinueIt is beneficial to assume control outside of the loop and move on to the following iteration.  
DefaultDescribes the "block of code" that will automatically run in a Switch statement.  
DoThe "do-while" loop's initial keyword.  
Double64-bit number-holding data type (floating-point).  
ElseThe "if" statements, defines the else component.  
Enuma Java declaration for enumerations.  
Extendssuggests inheritance. From another class, a class can be descended or inherited.  
Finalcreates a method or variable with fixed values that cannot be changed.
FinallySpecifies the finally block, which is what happens after the try-catch block, whether or not the exception was caught.  
Floatcapable of storing 32-bit floating-point numbers.  
Forshows that a "for" loop has begun.  
Ifbegins the "if" sentence.  
Implementsshows whether a class complies with an interface.  
Importused to add more packages or classes to the program or to reference them.  
InstanceOfa tool for determining whether an object is an instance of the specified class.  
IntContains a 32-bit integer value in a data type.
Interfaceused when announcing an interface.  
Long64-bit integer values are stored in a data type.  
Nativeutilized to denote native code (platform-specific).  
NewOperator for producing new objects.  
Nullrepresents a null reference.  
PackageJava package declaration keyword.  
PrivateA variable or method can only be accessed by the class in which it is declared when it is marked with the private access specified sign.  
ProtectedA protected access specifier is indicated by this term. When a variable or method is protected, only the class in which it is defined, its subclass, and other classes in the same package are permitted to access that variable or method.  
PublicPublic access specifiers are denoted by the keyword public. An application can access a variable, method, class, or interface that has been marked public.  
ReturnThe calling method receives the value of a method via return. Additionally, it's utilized to give the calling method back control.  
Short16-bit integer number values are stored in a data type.  
StaticWhen a method or variable is marked as static, it means it cannot be instantiated.  
StrictfpWhen calculating floating point values, the keyword strictfp limits the precision and rounding. Portability is ensured.  
Superthe class's base or superclass is indicated.  
SwitchIdentifies a switch statement that evaluates a condition and runs different cases based on the test result.  
SynchronizedIdentifies synchronized code blocks for multithreaded programs, such as important portions.  
ThisThe word "this" designates the active object.  
Throwas a throwable exception.  
ThrowsThis shows the exception that a method is capable of throwing.  
Transientspecifies a temporary variable that is not a component of an object's persistent state.  
TryAim for keywords to start a block that contains potentially exception-raising code.  
VoidNo return value is indicated.  
Volatileused to specify variables not kept in the main memory. They are modifiable asynchronously.  
WhileA while loop is started by the word while.  
ConstJava no longer supports the "const" keyword.  
GotoJava no longer supports the 'goto' keyword.  
True, false, and nullTrue, false, and null are literals. Nevertheless, they are ineffective as program identifiers.

Related Topics

PriorityBlockingQueue Class in Java

What is the Queue? An abstract data structure like Stacks is a queue. A queue is open on both ends. Data is always pushed to one end, called enqueue, and removed...

4 minutes read.

Scanner in Java

Static way of Programming: When a variable can’t change its value during run time is called a Static way of programming. In this programming a variable is directly assigned to a...

4 minutes read.

Java Math floorDiv() Method

The floorDiv () method of Math class returns the largest integer value that is less than or equal to the algebraic quotient. It firstly divides the dividend and divisor and...

2 minutes read.

Parallel Arrays Sort in Java

Sorting is a technique of arranging a sequence of numbers in ascending order, that is, the first number being lowest and gradually incrementing the numbers such that the last number...

7 minutes read.

Java StringBuffer vs StringBuilder

Java StringBuffer vs StringBuilder StringBuffer The StringBuffer class is used to create mutable string. StringBuffer shows writable and growable character sequences. Java StringBuffer program FileName: StringBufferExample.java // A basic program that demonstrates the working...

2 minutes read.

Java LinkedList

LinkedList Java The Java LinkedList is used to store the elements by using a doubly linked list. It contains the duplicate items, also maintains the order of the insertion, the class...

5 minutes read.

Banking Application in Java

JDBC (Java Database Connectivity), which provides an API to connect to, execute, and fetch data from any databases, can be used to handle transactions in Java. There are several factors...

7 minutes read.

Java Boolean getBoolean() Method

The getBoolean() method of Java Boolean class returns true if the specified system property is not null and is equal to the String ‘true’, else the result returned is false. Syntax public...

1 minute read.

Deadlock in Java

Deadlock is when two or more processes wait for the state to do their tasks, but none of them can do so. It is a very common problem that one...

6 minutes read.

Array Programs in Java

Array Programs in Java: An array is a data structure that stores similar elements in a contiguous memory location. In Java, an array is an object that stores the same...

7 minutes read.

Pig Latin Program in Java

Pig Latin Program in Java Pig Latin is a method for translating words of the English language into a different language. It is an encrypted word that is generated by using the following steps....

4 minutes read.

String isnullorempty in Java

What do you mean by String? Strings are a collection of characters that are commonly used in Java programming. Strings are regarded as objects in the Java programming language. “String” is a...

4 minutes read.

Java throws

Java throws: The Java throws keyword is used with the signature of the method to indicate that the method may raise an exception. The method that uses the Java throws...

3 minutes read.

Java Enumeration

In a computer language, enumerations express a set of named constants. For instance, the four suits in a deck of playing cards could be represented by the enumerators Club, Diamond,...

4 minutes read.

Perfect Number Program in Java

Perfect Number Program in Java A perfect number is a number whose sum of all the factors, excluding the number itself, is equal to the number. For example, 28 is a...

4 minutes read.

Pangram Program in Java

If a string comprises all alphabet letters from A to Z or from a to z without regard to case, it is referred to as a pangram. Some examples of pangram...

3 minutes read.

Ganesha’s Pattern in Java

This part teaches us how to use stars and other special characters to write Ganesha's Pattern in Java programming. Among the most challenging Java pattern applications to code. The Ganesha will be...

3 minutes read.

Binary Search Java

Binary search is a search mechanism for key elements from the given List/Array. In Binary search, the search mechanism is followed by dividing the array into parts; hence the search...

3 minutes read.

Null Pointer Exception in Java

It is a runtime error exception. The null value is allocated to the object reference in this exception. We will explicitly throw this null pointer exception when the program wants...

3 minutes read.

Differences between Byte Code and Machine Code

This tutorial will discuss the differences between Byte Code and Machine Code. Before that, let's try to know what byte and machine code is. Introduction Every computer has a set of instructions...

4 minutes read.