wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Keyword vs Reserved word! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Keyword vs Reserved word!" Watch "Keyword vs Reserved word!" New topic
Author

Keyword vs Reserved word!

sabyasachi mondal
Ranch Hand

Joined: Dec 26, 2000
Posts: 33
Hi,
If anyone can help me understand the distinction between java keywords and java reserved words.
Are true, false and null reserved or keywords? There might be more like these. I found from a resource (jwroxki mock) that null is not a keyword. But Sun book (Core Java2) put this word in the keyword series - page 698 (V1 by Horstman & Cornell).

Thanks for your time.
regds
mondal
Michael Ernest
High Plains Drifter
Sheriff

Joined: Oct 25, 2000
Posts: 7292

The terms "keyword" and "reserved word" may not be synonymous to some, but in practice they amount to the same thing: you cannot use these words as identifiers in your code.
All keywords are reserved words that perform a special function in the language. Since <code>true</code>, <code>false</code>, and <code>null</code> don't do anything -- they're "merely" pre-defined values -- some people don't consider them keywords. Ok, sure, fine.
There's another subset that for my money is more interesting: the words <code]goto></code>, <code>const</code>, and <code>byvalue</code> can't be used either. They do nothing at all! They have no function, no value, and can't be identifiers. I assume these words were stricken from the language because they represent features in C/C++ that Java does not allow.
-----------------
Michael Ernest, co-author of:The Complete Java 2 Certification Study Guide
[This message has been edited by Michael Ernest (edited January 13, 2001).]


Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
sabyasachi mondal
Ranch Hand

Joined: Dec 26, 2000
Posts: 33
Originally posted by Michael Ernest:
The terms "keyword" and "reserved word" may not be synonymous to some, but in practice they amount to the same thing: you cannot use these words as identifiers in your code.
All keywords are reserved words that perform a special function in the language. Since <code>true</code>, <code>false</code>, and <code>null</code> don't do anything -- they're "merely" pre-defined values -- some people don't consider them keywords. Ok, sure, fine.
There's another subset that for my money is more interesting: the words <code]goto></code>, <code>const</code>, and <code>byvalue</code> can't be used either. They do nothing at all! They have no function, no value, and can't be identifiers. I assume these words were stricken from the language because they represent features in C/C++ that Java does not allow.
-----------------
Michael Ernest, co-author of:The Complete Java 2 Certification Study Guide
[This message has been edited by Michael Ernest (edited January 13, 2001).]

Thank you Michael. So I would consider them not as java keywords in the jexam.
Thanks also for providing the URL of your java book.
regds,
mondal

 
Don't get me started about those stupid light bulbs.
 
subject: Keyword vs Reserved word!
 
Similar Threads
Is null a keyword?
keywords vs. reserved words
keyword vs. reserved word
reserved words and key words
One more time...