permaculture playing cards
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Keywords in the SCJP exam 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 "Keywords in the SCJP exam" Watch "Keywords in the SCJP exam" New topic

Keywords in the SCJP exam


Joined: Jan 07, 2005
Posts: 4

I have a question regarding the latest Programmer Certification.

In the book "Complete Java 2 Certification" (The Study Guide 4th ed by Heller and Roberts) the word "assert" is listed as a keyword or reserved word (see p. 5) but "assert" is not contained on tha page:

What is true for the latest version? Is "assert" protected or not?

Best regards,

--------------------<br />* SCJP 1.4 <br />* Ph.D. Mathemtician
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982
The book you refer is for J2SE 1.3, while assert is added in J2SE 1.4.


SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Is there are any more keyword added in J2SE 1.5 .

thank you very much .
Joseph Maddison
Ranch Hand

Joined: Nov 04, 2004
Posts: 53
It's a little more tricky than simply, it was added in 1.4. For example, the following compiles under Java 1.4 without error:

So, it is a keyword, but it can be used as if it weren't, for backward compatibility. Now, if you want to use assertions, you have to compile with the flag "-source 1.4" and run the JVM with -ea (enableassertions). Otherwise, the following would not compile:

Hope this helps,

Joined: Jan 07, 2005
Posts: 4
Hi again!

I think JD got it right! Thank you v. m. everyone.

// Anders
I agree. Here's the link:
subject: Keywords in the SCJP exam
It's not a secret anymore!