This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Assertions.

 
venkatesh rajmendram
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
sanjana narayanan
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic