assert is available in 1.4 only. By default, it is disabled
at runtime. If you don't specify the source at runtime, then the compiler will complain. Hence, given a file that has "assert" keyword in it, to compile you need to do this:-
javac -source 1.4 testAssert.java
if your old program is using the word assert as a variable name, then to make the compiler NOT complaining about it, do this:-
javac -source 1.3 testAssertNotKeyword.java
how do you enable assertions at runtime?
java -ea testAssert
voila! The need thing about assertion is you can control which package(s) need to have assertion enabled and which one is not.
~za~
You can't bring back a dead thread!