aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Do we assume assertion is disabled or enabled? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Do we assume assertion is disabled or enabled?" Watch "Do we assume assertion is disabled or enabled?" New topic
Author

Do we assume assertion is disabled or enabled?

Shanel Jacob
Ranch Hand

Joined: Jun 18, 2006
Posts: 112
Hi all, during the exam, do the questions actually tell you if assertion is enabled or disabled (since the "right" answer varies with assumption).
Sriram.Narayanan Thiagarajan
Greenhorn

Joined: Jul 21, 2006
Posts: 26
by default assertion is disabled

To enable assertion-awareness at compile time

javac -source 1.4 <FILE_NAME>

To enable assertion-awareness at run time

java -ea <FILE_NAME>
or
java -enableassertions <FILE_NAME>

Refer K&B for various options in it .
Gowher Naik
Ranch Hand

Joined: Feb 07, 2005
Posts: 643
By default assertions are disable at run time.
In question it will be mentioned(assertion enable or disable).
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Do we assume assertion is disabled or enabled?