Keyword in Java

  • Keywords are the reserved words that have some predefined meaning.
  • They cannot be used as a variable, literal and class name.
Java has 50 reserved keywords.

abstractcontinuefornewswitch
assertdefualtgotopackagesynchronized
booleandoifprivatethis
breakdoubleimplementsprotectedthrow
byteelseimportpublicthrows
caseenuminstanceofreturntransient
catchextendsintshorttry
charfinalinterfacestaticvoid
classfinallylongstrictfpvolatile
constfloatnativesuperwhile

Added in Java 1.2 = strictfp
Added in Java 1.4 = assert
Added in Java 5.0 = enum
Not used = goto, const