Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is true, false a keyword

 
Jyotsna Umesh
Ranch Hand
Posts: 94
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Few Java books say that true, false and null should be treated as keywords for certification exam purpose otherwise these are reserved words. Is it true?
Thanx
Jyotsna
 
Vanitha Sugumaran
Ranch Hand
Posts: 356
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
-----------------------
from Java Language Specification
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 (�3.10.7).
----------------------------
hope this helps,
Vanitha.
 
Jyotsna Umesh
Ranch Hand
Posts: 94
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi vanitha,
Thanks for clearing the matter but if the question is
Select the keywords in the given list
1. null
2. implements
3. throws
4. true
Then should I select all the four answers?
Thanks
Jyotsna

 
Percy Densmore
Ranch Hand
Posts: 214
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jyotsna,
1. null
2. implements
3. throws
4. true
Your list of words above are all included in the latest list of keywords and other reserved words. The latest one added is 'strictfp'. Hope that clears it up for you.
Percy
 
Jane Griscti
Ranch Hand
Posts: 3141
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JLS §3.9 lists all the legal keywords. If the word is not on the list, then it's not a keyword.
<code>true, false</code> and <code>null</code> are not on the list
Hope that helps.
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform
 
Jyotsna Umesh
Ranch Hand
Posts: 94
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jane Griscti:
JLS �3.9 lists all the legal keywords. If the word is not on the list, then it's not a keyword.
<code>true, false</code> and <code>null</code> are [b]not
on the list
Hope that helps.
[/B]

Thanks for clearing it, even i know these words are reserve words not kewords but am puzzled to read Philip's book that saya
treat these reserved words as key words for certification exam, is he wrong in saying this?
Thanx
Jyo
 
Vanitha Sugumaran
Ranch Hand
Posts: 356
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jyotsna ,
I couldn't answer when you ask whether to select or not? try this link,
http://www.javaranch.com/ubb/Forum24/HTML/000801.html
Vanitha.
 
Jyotsna Umesh
Ranch Hand
Posts: 94
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vanitha Sugumaran:
Hi Jyotsna ,
I couldn't answer when you ask whether to select or not? try this link,
http://www.javaranch.com/ubb/Forum24/HTML/000801.html
Vanitha.


Thanks Vanitha for the link but again they haven't reached at any final point, still its not clear to me whether i should select all options or not, How would you choose the options, please let me know, becoz this basic question has puzzled me in many mock exams, some treat these words as reserved, some as key words?
Jyotsna
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic