Home » Java Programming » Assertions

Which of the following statements is true?

Correct Answer: With the proper use of runtime arguments, it is possible to instruct the VM to disable assertions for a certain class, and to enable assertions for a certain package, at the same time.

Explanation:

Option C is true because multiple VM flags can be used on a single invocation of a Java program.


Option A is incorrect because at runtime assertions are ignored by default.


Option B is incorrect because as of Java 1.4 you must add the argument -source 1.4 to the command line if you want the compiler to compile assertion statements.


Option D is incorrect because the VM evaluates all assertion flags left to right.


← Previous Question Next Question→

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion