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


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).

Updated on: 18-Feb-2020

500 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements