wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes null 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 "null" Watch "null" New topic
Author

null

bobby chaurasia
Ranch Hand

Joined: Mar 30, 2002
Posts: 84
"null is not a keyword but a reserved word"
What's the difference between a keyword and a reserved word ? Are there any other reserved words ?
Thanks.
John Paverd
Ranch Hand

Joined: Nov 17, 2002
Posts: 115
Bobby
Since everyone else is quoting from Kathy and Bert's new book today, I will too As you can see, in addition to explaining Java, the book provides a lot of information about the exam, and what will and won't be tested.
According to the Java Language Specification, null, true, and false are technically literal values (sometimes referred to as manifest constants) and not keywords. Just as with the other keywords, if you try to create an identifier with one of these literal values, you�ll get a compiler error. For the purposes of the exam, treat them just as you would the other reserved words. You will not be asked to differentiate between reserved words and these reserved literals

[ January 08, 2003: Message edited by: John Paverd ]

SCJP 1.4
Kasi lingam
Greenhorn

Joined: Apr 01, 2003
Posts: 8
Originally posted by bobby chaurasia:
"null is not a keyword but a reserved word"
What's the difference between a keyword and a reserved word ? Are there any other reserved words ?
Thanks.

As Per Kathy Book, null,true,false are not keywords .They are called "Manifest Constant".
Dan Chisholm
Ranch Hand

Joined: Jul 02, 2002
Posts: 1865
Originally posted by Kasi lingam:
As Per Kathy Book, null,true,false are not keywords .They are called "Manifest Constant".


Yes, but the more important message from Kathy's book is the following.
For the purposes of the exam, treat them just as you would the other reserved words. You will not be asked to differentiate between reserved words and these reserved literals.


Dan Chisholm<br />SCJP 1.4<br /> <br /><a href="http://www.danchisholm.net/" target="_blank" rel="nofollow">Try my mock exam.</a>
Marlene Miller
Ranch Hand

Joined: Mar 05, 2003
Posts: 1391
Notice that the JLS and the Java Programming Language do not classify words as "reserved words". They say keywords are reserved. They say true, false and null are literals.
Keywords are reserved character sequences and cannot be used as identifiers. You cannot use language keywords as identifiers because they have special meaning within the language.
literals are the source code representation of values of a type. true, false and null are literals. You cannot use true, false or null as identifiers just as you cannot use 12 as an identifier.
[ April 06, 2003: Message edited by: Marlene Miller ]
 
Don't get me started about those stupid light bulbs.
 
subject: null