多项选择题
class Flow {
public static void main(String [] args) {
try {
System.out.print("before ");
doRiskyThing();
System.out.print("after ");
} catch (Exception fe) {
System.out.print("catch ");
}
System.out.println("done ");
}
public static void doRiskyThing() throws Exception {
// this code returns unless it throws an Exception
} }
可能会产生下面哪两项结果?()
A.before
B.before catch
C.before after done
D.before catch done
相关考题
-
多项选择题
1. import java.util.*; 2. 3. Class FindStuff { 4. public static void main(String [] args) { 5. // insert code here 6. c.put("x", 123); 7. } 8. } 分别插入到第5行,哪三行允许代码编译?()
A.Map c = new SortedMap();
B.HashMap c = new HashMap();
C.HashMap c = new Hashtable();
D.SortedMap c = new TreeMap(); -
多项选择题
1. class Calc { 2. public static void main(String [] args) { 3. try { 4. int x = Integer.parseInt("42a"); 5. //insert code here 6. System.out.print("oops "); 7. } 8. } 9. } 下面哪两行分别插入到第五行,会导致输出“oops”?()
A.} catch (ClassCastException c) {
B.} catch (IllegalStateException c) {
C.} catch (NumberFormatException n) {
D.} catch (IllegalArgumentException e) { -
多项选择题
以下关于File类的叙述,哪两项正确?()
A.File 类位于java.io 包中
B.创建一个File 类的实例将导致打开指定文件进行读写
C.File 实例封装了指定文件的信息
D.File 实例不能用于封装目录
