• 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
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

are strictfp, goto, const etc reserved words or keywords ?

 
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if we are asked in the exam which of the following are keywords and we have
goto
const
strictfp
widefp
true
false
null
which are true choices ? please be sure about your answer and explain. thanks
 
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
goto,const,strictfp are reserved--you cannot use any of these words as names in your Java programs.
true, false, and null are not keywords but they are reserved words, so you cannot use them as names in your programs either.
so the right answer would be goto,const & strictfp
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Vinod,what u said is correct.
If i changed the question as,
which of the following are reserverd words?
goto
const
continue
case
what would be the choices.(i'm totally confused with keywords and reserved words)
regards
Javeed
 
Vinod Venugopal
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
goto,const,continue,case -> all these are reserved & Java keywords.What it means is that you cannot use any of these words as names in your Java programs.
now true & false are boolean literals. they are also reserved words but they r not keywords. same goes for null also. You can think of it as the keywords are not values whereas tru,false,null represent some values. So when they say reserved it means they r kept for a reason, u can't use them in any other way.
 
You showed up just in time for the waffles! And this 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