2020
?/p>
JAVASE
综合考试试题?/p>
188
?/p>
[
含答?/p>
]
一、选择?/p>
1
?/p>
"
以下代码的输出结果是什么?
public class Example {
public static void main(String[] args) {
System.out.println(Math.round(Float.MAX_V
ALUE));
}
}"
答案
:B
A.
输出
Integer.MAX_V
ALUE
B.
输出一个最接近
Float.MAX_V
ALUE
的整?/p>
C.
编译失败
D.
运行时输出异常信?/p>
2
?/p>
"
现有代码如下?/p>
public class Example {
void topGo() {
try {
middleGo();
} catch (Exception e) {
System.out.println(""catch"");
}
}
void middleGo() throws Exception {
go();
System.out.println(""late middle"");
}
void go() throws Exception {
throw new Exception();
}
public static void main(String[] args) {
Example example = new Example();
example.topGo();
}
}