• HTML
  • CSS
  • JAVASCRIPT
  • JAVA
  • HTML
  • CSS
  • JAVASCRIPT
  • JAVA

Java Keywords

Java includes a collection of reserved words, known as keywords, which cannot be employed as identifiers for variables, methods, classes, or any other programming constructs.

List of Java Keywords:

KeywordDescription
abstract abstract keyword is used to declare abstract classes and methods. An abstract class can not be used to create an object. but it can provide the implementation of the interface. moreover, It can have abstract and non-abstract methods.
assertIt is used for debugging
booleanboolean data type is used to store true and false value.
breakbreak keyword is used to break the loop or switch statements. simple it breaks the program flow.
byteIt is data type that can store numbers from -128 to 127.
caseIt is used for write case block in switch statement.
catchCatch keyword is used to catch the exceptions which is generated by try block. It always placed after try.
charThis datatype is used to store single character value.
classclass keyword is used to declare class.
continuecontinue keyword is used to to continue the loop. so basically continues to the next iteration of a loop.
defaultIt is used to specify default block in switch case statements.
doUsed together with while loop to create do-while loop
doubledouble keyword is used to declare a variable that can hold 64 bit floating value.
elseIt is used for add condition with if statements.
enumDeclares an enumerated type.
extendsextend keyword is used in inheritance and interface where you can derived class from another class or interface.
finalfinal keyword is used to denote constants. It can be used with variables, methods and classes. We can not change the value of final variable.
finallyfinally keyword used with exceptions, finally block of code will be executed no matter if there is an exception or not.
floatIt is one type of datatype. Generally it is used to store floating(Pointing Value) data.
for Creates for loop. Provides functionality to perform set of operations repeatedly.
ifIf keyword tests the condition. execute the block if condition is true.
implementsImplements keyword implement interface.
importUsed to import Packages, class and Interface.
instance ofInstance of keyword is used to checks whether an object is an instance of a specific class or an interface
longIt is a data type and it can hold a 64-bit integer.
nativeSpecifies that a method is not implemented in the same Java source file (but in another language)
newCreates new objects
PackageDeclares a package
PrivatePrivate is access modifier. it is used to indicate that method or variable maybe accessed only in class which it is declared.
Protected An access modifier used for attributes, methods and constructors, making them accessible in the same package and subclasses
PublicAn access modifier used for classes, attributes, methods and constructors, making them accessible by any other class
return Finished the execution of a method, and can be used to return a value from a method
shortIt is a data type and it can hold a 16-bit integer.
static It is non-access modifier used for methods and attributes. Static methods and attributes can be accessed without creating an object.
strictfpRestrict the precision and rounding of floating point calculations
superRefers to Superclass(Parent class) object into child class
switchThe switch statement tests the equality of a variable against multiple values.
synchronizedThis keyword is used in multithreading, which specifies that methods can only be accessed by one thread at time.
thisthis keyword can be used to refer the current object in a method or constructor.
throwIt is used to explicitly throw an exception and mainly used to create custom exceptions.
throwsJava throws keyword is used to declare an exception. Checked exceptions can be propagated with throws.
transientJava transient keyword is used in serialization. If you define any data member as transient, it will not be serialized.
tryCreates a try…catch statement
voidSpecifies that a method should not have a return value
volatileJava volatile keyword is used to indicate that a variable may change asynchronously.
whileCreates a while loop

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Course Content

  • JAVA
    • C++ vs Java
    • Features of Java
    • First Java Program
    • How to set Java path?
    • Internal Working of Java Program
    • Java Control Statements
    • Java Datatypes
    • Java Operators
    • Java Variables
    • JDK, JRE and JVM
    • Keyword
    • What is java

© 2025. ITTrainingWala