true false and null are not keywords but they are reserved. When asked in scjp we should not choose these three as reserved
Geoff Wass
Greenhorn
Joined: Jun 10, 2004
Posts: 3
posted
0
true false and null are represent literals (the first two are boolean literals, the third is assigned to objects), that is why they are reserved.
The keywords are actually "words" used by the Java language, that is why you can't use them as properties, class or method names.
Geoff Wass<br />Montr�al, Qu�bec, Canada
Corey McGlone
Ranch Hand
Joined: Dec 20, 2001
Posts: 3271
posted
0
Keywords are words that have a special meaning in Java. Things like "while" and "if" are keywords. Literals are words that represent a specific value, such as "true" and "false." Reserved words is the union of those two sets.
In short, reserved words are all of the Strings that you can't use for your own purposes (variable names, class names, etc.) For example, you can't have a variable named "while" or "false."
As far as the SCJP exam goes, you need not be able to differentiate between keywords and literals. You only need to know what words make up the set of reserved words (which consists of all of the keywords and all of the literals).
1. 'true', 'false' and 'null' are called as "manifest constants". They are treated as reserved keywords but they are, practically, just reserved literals (that is, using which as identifiers would cause a compiler error!).
2. 'goto' and 'const' are reserved keywords but are not used.
However, the SCJP Exam Objectives/Pre-requisites quotes:
There will not be any questions regarding esoteric distinctions between keywords and manifest constants.
Hope this helps!
Good luck! -Rao
Work will teach you how to do it!<br />----------------------
kapil munjal
Ranch Hand
Joined: May 11, 2004
Posts: 298
posted
0
Thanks a lot friends for your reply.
Actually I have never come across such type of distinction between keywords and reserved words, so I just wanted to know the difference.
Thanks Kaps
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.