File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

goto , const problem

 
Bharat Keskar
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys,
i have a simple problem.
As you know 'goto' and 'const' are keywords in java which are not currently used.
in some mock exams the options do have these keywords.
some mock exams accept it and some do not.
My question is , for the cerification exam ,
are we suppose to check the options showing the two keyword?..
please help.
bharat
 
Anthony Villanueva
Ranch Hand
Posts: 1055
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as the JLS is concerned, const and goto are keywords.
 
Ron Newman
Ranch Hand
Posts: 1056
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The important things to know are that Java doesn't have these two features, but the words are reserved so that you can't use them as identifiers.
 
Bishal P
Ranch Hand
Posts: 43
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which site says that goto and const are NOT keyword? Tell me the name so that i dont waste my time there. just kidding.. i think everyone knows that goto and const are keywords coz it comes in every mock exam. I am sure sun will never ask that one.
However i have got a similar question. If someone asks whether null, true and false are keywords,then i am confused coz according to books they are literals and not in the keyword list.But i sure can't use them as identifiers in my program.

Thanks
Bishal
 
Anthony Villanueva
Ranch Hand
Posts: 1055
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the same link above:

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).
 
Bishal P
Ranch Hand
Posts: 43
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks anthony, i have read those lines from the bible before..
I was just making sure that sun wouldnt mind if i said null, true and false are not keywords.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic