File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Reserved words Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Reserved words" Watch "Reserved words" New topic

Reserved words

Vineela Devi
Ranch Hand

Joined: Dec 20, 2003
Posts: 191
can anyone please explain the difference between keywords and reserved words and also please give the list of reserved words in java.
Elouise Kivineva
Ranch Hand

Joined: Feb 07, 2002
Posts: 154
The reserved words include some words that are not yet keywords but a possible need for them to be keywords (prob. because they are keywords in some other languages) is anticapated and so guarded against by reserving them from the get-go.
They can be found here:
Vineela Devi
Ranch Hand

Joined: Dec 20, 2003
Posts: 191
Hai Friend,
I got the differnece between reserved words and key words ,but sorry to say that in the link given by you,the list of java reserved words includes most of java's keywords like abstarct etc. can anyone please give the list of only java's reserved words?
m bhramaresh

Joined: Jan 09, 2004
Posts: 13
Keywords are special reserved words in java.
There are 48 reserved keywords in the java language. These keywords cannot be used as names for a variable,class or method.
In addition to these 48 reserved keywords java also reserves : true, false and null. These also may not be used for names of variables, classes.
Any book on Java that you refer to will enumerate these reserved keywords.
Hope it is clear.
Keyword: one of
abstract default if private this
boolean do implements protected throw
break double import public throws
byte else instanceof return transient
case extends int short try
catch final interface static void
char finally long strictfp volatile
class float native super while
const for new switch
continue goto package synchronized
The keywords const and goto are reserved, even though they are not currently used. This may allow a Java compiler to produce better error messages if these C++ keywords incorrectly appear in programs.
While true and false might appear to be keywords, they are technically Boolean literals (�3.10.3). Similarly, while null might appear to be a keyword, it is technically the null literal
abstract default if private throw
boolean do implements protected throws
break double import public transient
byte else instanceof return try
case extends int short void
catch final interface static volatile
char finally long super while
class float native switch
const for new synchronized
continue goto package this
these r the reserved words of java.
may this help for u.
I agree. Here's the link:
subject: Reserved words
It's not a secret anymore!