File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

Keywords in the SCJP exam

ADSWED
Greenhorn

Joined: Jan 07, 2005
Posts: 4
Hi!

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:
http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords.html

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

Best regards,
Anders


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

Nick


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,
jdmaddison
ADSWED
Greenhorn

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: http://aspose.com/file-tools
 
subject: Keywords in the SCJP exam