| Author |
goto , const problem
|
Bharat Keskar
Greenhorn
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. bharat
|
 |
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. Thanks Bishal
|
_ _____ _ <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.
|
 |
 |
|
|
subject: goto , const problem
|
|
|