You probably did not run your program with assertions enabled. To do that, specify either -ea or -enableassertions as a command-line switch. Assertions are disabled by default.
Joined: Oct 09, 2007
I have seen a statement saying::
I we are using jdk 1.4 compiler the assertions are disabled by default.. But when we are using jdk 1.5 the assertions are enabled by default. If that was the case no need to enable assertions ...
Is that statement right?? or still what ever compiler we are using we should enable assertions?? Let me know
Thanks in advance
Kelvin Chenhao Lim
Joined: Oct 20, 2007
You're confusing the behavior of the Java compiler (javac) with that of the Java runtime launcher (java). In both 1.4 and 1.5, the runtime launcher will disable assertions by default. However, the 1.4 compiler does not support assertions by default, whereas the 1.5 compiler does. [ November 30, 2007: Message edited by: Kelvin Lim ]