• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Question from javeed Ansar

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
The follg. is a question from site http://www.javeedansar.domainvalet.com
12.Identify the keywords from the following

a] finally
b] true
c] return
d] sizeof
e] null

Answer:a,c
Why b,e are not included?
------------------
Cheers,
Deepa
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
b & e are also keywords!!! no doubt about that.
pankaj
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As far as I know - true, false and null are not keywords, they are reserved words. For all practical purposes they are treated as keywords but actually they are reserved words.
Now the question comes - what is the difference?
Well can some one answer that.
 
Ranch Hand
Posts: 144
Redhat Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Deepa ,Pankaj ,Rakesh
read the following post about it in JLS
posting the relevent portion
Refer JLS- 3.9
"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). "
thus true false and null are not Keywords.they are literals...
Some one had a talk with Michael Ernest- (of RHE) earlier.
Michael then had said that such confusing questions will not be coming in real Exams...I am sorry I dont have a link to that post...( HOpe someone can provide that )
Perhaps, I saw that in Javacertstudy group.
HTH
Sunil Choudhary
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Deepa,

true,null & false are not the keyword but these are reserved literals.
Shashank
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic