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.
abstract | continue | for | new | switch |
assert | defualt | goto | package | synchronized |
boolean | do | if | private | this |
break | double | implements | protected | throw |
byte | else | import | public | throws |
case | enum | instanceof | return | transient |
catch | extends | int | short | try |
char | final | interface | static | void |
class | finally | long | strictfp | volatile |
const | float | native | super | while |
Added in Java 1.2 = strictfp
Added in Java 1.4 = assert
Added in Java 5.0 = enum
Not used = goto, const