This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes reserved words Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "reserved words" Watch "reserved words" New topic

reserved words

Chitra Jay
Ranch Hand

Joined: May 02, 2002
Posts: 76
Exam Cram says byvalue,future,inner,rest,cast,generic,operator,
var are some of the reserved words not currently in use other than const and goto.
But i didnt get any compiler error when i used it in my program(i got error when i used const and goto..) Why is this?
Jamal Hasanov
Ranch Hand

Joined: Jan 08, 2002
Posts: 411
Hi, Chitra
List of reserved keywords:
JLS 3.9 Keywords

Jamal Hasanov
Rob Ross

Joined: Jan 07, 2002
Posts: 2205
Chitra, those "extra" words were once being considered for inclusion in the Java 1 language spec, but they were dropped. Some authors who had gotten an advanced copy of the spec included them, and after they were dropped from the official spec, their books were out-of-date.
goto and const are still reserved words. They just aren't implemented in the current java spec. They are reserved mainly for the benefit of C++ programmers and those porting old C++ code to java.
Use the link Jamal gave you as the current correct version of the Java reserved words.
[ May 25, 2002: Message edited by: Rob Ross ]

SCJP 1.4
Chitra Jay
Ranch Hand

Joined: May 02, 2002
Posts: 76
Thanks a lot guys
Francisco A Guimaraes
Ranch Hand

Joined: Mar 20, 2002
Posts: 182
why assert isn�t in teh keywords list? it is valid in java 1.4...

Francisco<br />SCJP<br />please use the [code][/code] tags when showing code.Click <a href="" target="_blank" rel="nofollow">here</a> to see an example.
Swati Gupta
Ranch Hand

Joined: May 28, 2002
Posts: 106
what is assert? I have seen it many places in the discussion of beta 1.4
Corey McGlone
Ranch Hand

Joined: Dec 20, 2001
Posts: 3271
An assertion, in brief terms allows you to test an assumption in your program. If that assumption fails, your program fails to let you know.
Check out this.

SCJP Tipline, etc.
Swati Gupta
Ranch Hand

Joined: May 28, 2002
Posts: 106
Thanks a lot.I am planning to appear in Exam in June. I think I should not worry about it now. But I will read it once I am done with exam.
Don't get me started about those stupid light bulbs.
subject: reserved words
Similar Threads
Is "goto" a Java keyword?
reserved key words
Jai Question : 4 on keywords
confusion with the question
unused keyword