当前位置:首页 > 精选JAVASE综合完整题库188题(含答案)
2020年JAVASE综合考试试题库188题[含答案]
一、选择题
1.调用Math.random()方法最有可能输出以下哪些结果? 答案:D
A.-0.12和0.56E3 B.0.12和1.1E1 C.-23.45和0.0 D.0.356和0.03
2.\以下代码中,如果test()方法抛出一个NullPointException异常时,打印输出什么内容?
class Example {
public static void main(String[] args) throws IOException { try { test();
System.out.println(\
} catch (ArrayIndexOutOfBoundsException e) { System.out.println(\ }finally{
System.out.println(\ } } }\答案:
A.打印输出Message1 B.打印输出Message2 C.打印输出Message3 D.以上都不对
3.\以下代码执行结果是什么? class Example {
public static String output = \ public static void foo(int i) { try {
if (i == 1) {
throw new Exception(); }
output += \
共分享92篇相关文档