wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Assertion topic Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Assertion topic" Watch "Assertion topic" New topic

Assertion topic

Chandana Garlapati
Ranch Hand

Joined: Jul 06, 2009
Posts: 97

The above program is from MasterExam(but slightly modified)
In the above program assert statements are false so bar() and foo() methods should be called

but why the output is done??

can anyone explain???
Raju Champaklal
Ranch Hand

Joined: Dec 10, 2009
Posts: 521
because when you ran the program you did not enable the assertions

scjp 1.6 91%, preparing for scmad
"Time to get MAD now.. we will get even later"....by someone unknown
Minhaj Mehmood
Ranch Hand

Joined: Jan 22, 2007
Posts: 400

try this java -ea Test

SCJP6 96% | SCWCD5 81% | SCDJWS5 79%
Chandana Garlapati
Ranch Hand

Joined: Jul 06, 2009
Posts: 97
oh k Thank you guys..
wood burning stoves
subject: Assertion topic
Similar Threads
Qn on assertion.
two possible answers Q18 ch 4 page 282 from KB
Confusing Assertions Question
Assertion Question