问题:
public class Test {
public static void main(String[] args) {
int x = 0;
assert (x > 0) ? “assertion failed” : “assertion passed”;
System.out.println(“Finished”);
}
}
What is the result?()
A . finished
B . Compilation fails.
C . An AssertionError is thrown and finished is output.
D . An AssertionError is thrown with the message “assertion failed”.
E . An AssertionError is thrown with the message “assertion passed”.
public class Test {
public static void main(String[] args) {
int x = 0;
assert (x > 0) ? “assertion failed” : “assertion passed”;
System.out.println(“Finished”);
}
}
What is the result?()
● 参考解析
本题暂无解析
相关内容
相关标签