当前位置:SCJP程序员认证考试题库

问题:

[单选]

public class Test { 
public static void main(String[] args) { 
int x = 0; 
assert (x > 0): “assertion failed”; 
System.out.println(“finished”); 
} 
} 
What is the result?()  

A .  finished
B .  Compilation fails.
C .  An AssertionError is thrown.
D .  An AssertionError is thrown and finished is output.

某种情况的L=10,E=6,C=15,则根据风险评价的LEC法,可判断为()。 容许风险。 中度风险。 重大风险。 不容许风险。 寻租的本质在于()。 今日的西藏、新疆、臺灣等地於何時納入中國版圖?() 唐。 元。 明。 清。。 以下属于新型农业经营主体的有() 专业大户。 农民合作社。 产业化龙头企业。 家庭农场。 个体工商户。 证券投资基金是一种()的证券投资方式。  间接。  以上均不正确。  直接。  视具体的情况而定。

public class Test { 
public static void main(String[] args) { 
int x = 0; 
assert (x > 0): “assertion failed”; 
System.out.println(“finished”); 
} 
} 
What is the result?()  

参考答案:

  参考解析

This question is a bit tricky because it lacks the following information: It should include a statement that says whether or not assertions are enabled. If they are indeed enabled, the 
correction answer is C. but if they are not, the correct answer is A. Assertions are not enabled by default so if the question is not changed, the most logical answer is A.

在线 客服