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 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

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[]){
Am I missing something here???
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 ...


- satya
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
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:
which I try to keep up to date.
I agree. Here's the link:
subject: Java reserved keywords
It's not a secret anymore!