Java Keywords

Java Keywords

Java Keywords

Java Keywords:

In Java, a keyword is a reserved word that has a specific meaning and cannot be used for any other purpose, such as variable or method names. Here is a list of the keywords in Java:

abstractassertbooleanbreakbyte
casecatchcharclassconst*
continuedefaultdodoubleelse
enumextendsfalsefinalfinally
floatforgoto*ifimplements
importinstanceofintinterfacelong
nativenewnullpackageprivate
protectedpublicreturnshortstatic
strictfpsuperswitchsynchronizedthis
throwthrowstransienttruetry
voidvolatilewhile

These keywords have specific meanings in Java, and their usage is restricted to the language constructs they are associated with. For example, the “if” keyword is used to define a conditional statement, the “class” keyword is used to define a class, and the “new” keyword is used to create a new object.

It’s important to note that certain keywords, such as “const” and “goto,” are reserved but not used in Java. Also, the “enum” keyword was added in Java 5 to support enumeration types.

Join To Get Our Newsletter
Spread the love