本文共 492 字,大约阅读时间需要 1 分钟。
2020年JAVASE综合考试试题库188题[含答案]
一、选择题
1.下列哪些项是泛型的优点?
答案:A
A.不用向下强制类型转换
B.代码容易编写
C.类型安全
D.运行速度快
2."以下代码的输出结果是什么?选择所有的正确答案。
class Example {
public static void main(String[] args) throws IOException {
for (int i = 0; i < 10; i++) {
try {
try {
if (i % 3 == 0)
throw new Exception(""E0"");
System.out.println(i);break;
} catch (Exception inner) {
i *= 2;
if (i % 3 == 0)
throw new Exception(""E1"");
} finally {
++i;
}
} catch (Exception outer) {
i += 3;
} finally {
--i;
}
}
}
}"
答案:
A.4
B.5
C.6
D.7
转载地址:http://snncl.baihongyu.com/