Q. Consider the following code fragment:
public class AssertionExample2 {
public static void main(
String[] args) {
System.out.println(args.length);
assert args.length != 0;
}
}
Which of the following must be done in order for the code to throw an AssertionError?
(Choose all that apply.)
A. The code must be compiled with the -source 1.4 option if you are using JDK 5.0.
B. The program must be executed with the -ea option.
C. At least one argument must be given in the execution command.
D. No argument should be given in the execution command.
i tried compiling without source option its giving me results like 0 which is expected but compiling with source option also happens to provide me with the same answer which makes things confusing.