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).
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
posted
0
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
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.