This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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


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).
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Do we assume assertion is disabled or enabled?
 
It's not a secret anymore!