Home » java » Java Keywords

Java Keywords

Java contains 53 reserved words out of which 50 are keywords out of 50 only 48 keywords are used and two keywords const and goto are not in use and 3 are literals values true, false and null.

These reserved words can not be used as identifiers.

java reserved words hierarchy
java reserved words hierarchy

Java Keywords:   keyword is a reserved word that has a predefined meaning in the language, therefore, we cannot use keywords as names as a  class, methods, variable name or as any other identifier. Keywords of java are:

abstractcontinuefornewswitch
assertdefaultgotopackagesynchronized
booleandoifprivatethis
breakdoubleimplementsprotectedthrow
byteelseimportpublicthrows
caseenuminstanceofreturntransient
catchextendsintshorttry
charfinalinterfacestaticvoid
classfinallylongstrictfpvolatile
constfloatnativesuperwhile

const and goto are not in use
strictfp added in jdk 1.2
enum added in jdk 1.5

Reference

  1. Java Language Keywords
  2. List of Java keywords

Managed by MochaHost - Fast & Easy WordPress Hosting