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 Dan's Q of Assertion? 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 "Dan Watch "Dan New topic

Dan's Q of Assertion?

Vishy Karl
Ranch Hand

Joined: Sep 08, 2003
Posts: 116
Following is the Q from Dan's Exam

Ans given are a,b,d.
Why is b also correct ?? If assertions r disabled then how will it show AssertionError message ?

"The man who can drive himself further once the effort gets painful is the man who will win." <br />Roger Bannister
Rama Kumar PV

Joined: Dec 26, 2003
Posts: 26
It is just like any other error/exception and is not related to enabling or disabling of assertions. Enabling/Disabling of assertions will affect only those lines having the assert keyword followed by a boolean expression.
I agree. Here's the link:
subject: Dan's Q of Assertion?
It's not a secret anymore!