Java Keywords and Reserved words
Reserved words are words that are reserved by the language for future use.
Keywords have a special meaning in a language, and are part of the syntax.
All keywords are reserved words, but not all reserved words are keywords.
keywords and reserved words cannot be used as identifier names
There are 53 keywords and Reserved words in java.
in that
48 are used keywords(given in below table)
2 are unused keywords(goto, const)
and remaining 3 are literals(true, false, null)
category | keywords |
---|---|
Class | class, extends, implements, interface |
Object | new, this, super |
Package | package, import |
Access Modifiers | public, private, protected |
Non-Access Modifiers | abstract, final, static, strictfp, volatile, transient, native, synchronized |
Flow Control | break, case, continue, else, if, default, do, for, instanceOf, switch, while, return |
Primitive Types | byte, short, int, long, float, double, char, boolean |
Exception | try, catch, finally, assert, throw, throws |
Enumeration | enum |
return type | void |