What is the difference between keywords and reserved words in Java?

Java 8Object Oriented ProgrammingProgramming

Keywords

Keywords in Java convey a special meaning to the compiler therefore, these cannot be used as identifiers. Java provides a set of 50 keywords.

abstractcontinuefornewswitch
assertdefaultgotopackagesynchronized
booleandoifprivatethis
breakdoubleimplementsprotectedthrow
byteelseimportpublicthrows
caseenuminstanceofreturntransient
catchextendsintshorttry
charfinallongstrictfpvolatile
constfloatnativesuperwhile

Reserved words

Among the list of key words list mentioned above the key words goto and const are currently not in use. They are reserved words (for the future use).

raja
Updated on 18-Feb-2020 11:11:37

Advertisements