"The man who can drive himself further once the effort gets painful is the man who will win." <br />Roger Bannister
Gian Franco
blacksmith
Ranch Hand
Joined: Dec 16, 2003
Posts: 975
posted
0
Originally posted by Vishy Karl: Hi all , another one from javacertificate.com Which of the following statements will compile AssertTest.java to use assertions?
Assertions where added in Java 1.4. If you compile with the option Java 1.3, assertions won't be considered at all and you can even use the word assert as a method name for example. In order to 'activate' assertions during run-time you will have to use the flag -ea. But of course this is only possible if you compiled with the Java 1.4 option. Greetings, Gian Franco
"Eppur si muove!"
Vicken Karaoghlanian
Ranch Hand
Joined: Jul 21, 2003
Posts: 522
posted
0
Originally posted by Vishy Karl: Answer given is 4. why is it so ??
Because that's the way it is. 'source' is used to provide compatibilty with the specific release (in your case 1.4) The first two are used with the 'java' command not 'javac', it is used to enable assertion at runtime. The third one is used to compile a normal source file that does not contain the 'assert' keyword.
- Do not try and bend the spoon. That's impossible. Instead, only try to realize the truth. <br />- What truth? <br />- That there is no spoon!!!
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.