Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Assertions. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Assertions." Watch "Assertions." New topic
Author

Assertions.

venkatesh rajmendram
Ranch Hand

Joined: Dec 05, 2000
Posts: 130
Hi,
What is the difference between
java -ea and
java -dsa
First one says enable assertions at runtime for all classes except for the system calsses
second one says enable assertions in general, but disable in system classes.
Any clarifications....
Also what type of question can be asked in exam ..any tips...?
Thanks
Venkatesh


SCJP 1.4, SCWCD<p>Ours is a world where people don't know what they want and are willing to go through hell to get it.<br /> - Don Marquis
sanjana narayanan
Ranch Hand

Joined: Nov 25, 2003
Posts: 142
Originally posted by venkatesh rajmendram:
Hi,
What is the difference between
java -ea and
java -dsa
First one says enable assertions at runtime for all classes except for the system calsses
second one says enable assertions in general, but disable in system classes.
Any clarifications....
Also what type of question can be asked in exam ..any tips...?
Thanks
Venkatesh

java -ea
enable assertions at runtime for all classes except for the system calsses . This is true
java -dsa
We are disabling the assertions for the system classes. By default
the assertions are disabled for all classes at runtime. So we have to explicity give -ea to enable the assertions.
Hope it is clear.
-Sanjana
venkatesh rajmendram
Ranch Hand

Joined: Dec 05, 2000
Posts: 130
Oh!! I misstyped it , it is supposed to be
java -ea -dsa
and
java -ea
they both mean the same...I guess ...any clarification is appreciable
Thanks
Venkatesh
Marlene Miller
Ranch Hand

Joined: Mar 05, 2003
Posts: 1391
Hi Venkatesh,
�ea �dsa and �ea mean the same thing.
Here are some insights into the assertion switches:
1. To make it easy to turn on asserts in all classes except for system classes, -ea does not apply to system classes.
2. Since �ea does not apply to system classes, a separate switch is provided to enable asserts in all system classes. �esa
3. �For symmetry, a corresponding switch is provided to disable asserts in all system classes, though it is not clear that there exists a use for this switch.� -dsa
http://java.sun.com/docs/books/jls/assert-spec.html Appendix II
[ December 23, 2003: Message edited by: Marlene Miller ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Assertions.
 
Similar Threads
Question about assertions..
selective enabling and disabling in assertion
Enabling or disabling assertions
Assertions - command line switches
Assertion - what are system classes?