Keywords Java

Every programming language comes with keywords. A keyword is just a word which has got a special meaning and purpose to the compiler. For this reason, we cannot use them in our program to identify our own (to give a name) a class, variable or method.

Keywords Java: Some people interchangeably use the two words, keyword and reserved word. They think both are same; may be correct in many programming languages. But in Java, they are different. While Java is being developed, the designers placed the two words, goto and const in reserved word list and not in keyword list. Designers placed in reserved list for the reason thinking that goto and cosnt may be required in future versions of Java; any time they may be brought into keyword list. But as on today, Java proved that a programming language can exist without these two words.

Keywords Java: List of 48 keywords (upto JDK 1.8).
abstract assert boolean break byte
case catch char class continue
default do double else enum
extends final finally float for
if implements import instanceof int
interface long native new package
private+ protected public return short
static strictfp super switch synchronized
this throw throws transient try
void volatile while

1. strictfp is added in JDK 1.2
2. assert is added in JDK 1.5
3. enum is added in JDK 1.5

Following is the list of 2 reserved words.

const goto

Following is the list of prohibited 3 literals (given as values) which cannot be used in Java coding.

true false null

Total you cannot use 53 words in Java coding.

Leave a Comment

Your email address will not be published.