• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

reserved words

 
Chitra Jay
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
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
Posts: 411
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Chitra
List of reserved keywords:
JLS 3.9 Keywords

Jamal Hasanov
www.j-think.com
 
Rob Ross
Bartender
Posts: 2205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Chitra Jay
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot guys
 
Francisco A Guimaraes
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why assert isn�t in teh keywords list? it is valid in java 1.4...
 
Swati Gupta
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is assert? I have seen it many places in the discussion of beta 1.4
 
Corey McGlone
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Corey
 
Swati Gupta
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic