File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes goto , const problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "goto , const problem" Watch "goto , const problem" New topic

goto , const problem

Bharat Keskar

Joined: Aug 26, 2002
Posts: 11
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.
Anthony Villanueva
Ranch Hand

Joined: Mar 22, 2002
Posts: 1055
As far as the JLS is concerned, const and goto are keywords.
Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
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.

Ron Newman - SCJP 1.2 (100%, 7 August 2002)
Bishal P
Ranch Hand

Joined: Sep 06, 2002
Posts: 43
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.


_ _____ _ <br />Used to be a Java Programmer but now I work on Microsoft Technologies - Word, Excel and Outlook!
Anthony Villanueva
Ranch Hand

Joined: Mar 22, 2002
Posts: 1055
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

Joined: Sep 06, 2002
Posts: 43
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.
I agree. Here's the link:
subject: goto , const problem
It's not a secret anymore!