What's are Java keywords?

keywords are reserved identifiers. Predefined identifiers in Java language, that is, they are used in a program exclusively the way already defined by Java. All the keywords are in lowercase. Java compiler enforces this predefined usage. Incorrect usage of keywords if flagged by the compiler and results in compilation errors.

These are the keywords currently defined and used in Java:

abstract default if private this
assert do implements protected throw
boolean double import public throws
break else instanceof return transient
byte enum int short try
case extends interface static void
catch final long strictfp volatile
char finally native super while
class float new switch
continue for package synchronised



Additionally, Java has two reserved keywords which are currently not in use:
const goto

Note: you can't use keywords either used or just reserved by Java.


No comments: