How many Reserved words/Keywords are available in Java?

In Java, There are 53 reserved words are available to represent some meaning
or functionality such type of words are called as reserved words.

Reserved Words(53)
|
|-----Keywords(50)
|-----Reserved Literals(3) true,false,null


Keywords(50)
|
|----Used Keywords(48)
|----Unused Keywords(2) goto,const


Keywords for Data types(8)
|----byte, short, int, long, float, double, char, boolean

Keywords for Flow Control(11)
|----if, else, switch, case, default, while, do, for, break, continue, return

Keywords for Modifiers(11)
|----public, protected, private, final, static, abstract, native, synchronized, volatile, transient, strictfp

Keywords for Exception Handling(6)
|----try, catch, finally, throw, throws, assert

Class related Keywords(6)
|----class, interface, package, import, implements, extends

Object related Keywords(4)
|----new, super, this, instanceof

Void return type Keyword(1)
|----void


Unused Keywords(2)
------------------
goto:- Usage of "goto" keyword, created several problems in old languages. Hence Sun people banned this keyword in Java.
const:- We can use "final" keyword instead of "const" keyword.

Note:- By mistake if we are using these two keywords then we will compile time error.

0 comments: