aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Java reserved keywords 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 "Java reserved keywords" Watch "Java reserved keywords" New topic
Author

Java reserved keywords

Shafeeq Sheikh
Ranch Hand

Joined: May 12, 2000
Posts: 68
Hi guys....
In Bill Brodgen's book exam cram, he mentions that cast, future,
generic, inner, operator,outer are all reserved keywords that cannot be used. (pg 16)
While I wrote a small piece of code where I used these successfully.
public class Test{
static int cast = 5;
static int future = 6;
static int generic = 7;
static int inner = 8;
static int operator = 9;
static int outer = 10;
public static void main(String args[]){
System.out.println(Test.cast);
System.out.println(Test.future);
System.out.println(Test.generic);
System.out.println(Test.inner);
System.out.println(Test.operator);
System.out.println(Test.outer);
}}
Am I missing something here???
Thanks....
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944

Authorized java site for key words and reserved words
for Java 2....hopefully you are preparing for SCJP2...
Java Language Keywords
A previous discussion on this topic ...
http://www.javaranch.com/ubb/Forum24/HTML/001532.html

Regds.

- satya
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
The story on that reserved word table in my books is this:
I was depending on the information in the Java in a Nutshell book which I re-organized for that table. It turned out that Flannagan re-used information from the pre-JDK 1.02 release of Java in which there were a lot of words reserved by the design team.
Sun changed the reserved word list BUT did not mention the change in the release documents so both Flannagan and I published an obsolete list. Anybody using the Java 2 Exam Cram or Java 2 Exam Prep books should get the errata from: http://www.lanw.com/books/errata/
which I try to keep up to date.
 
 
subject: Java reserved keywords