Java认证模考试题(八)
百度广告
public void fun ()
{
int i;
try
{
i=System.in.read ();
System.out.println(Location 1);
} catch (IOException e) {
System.out.println(Location 2);
} finally {
System.out.println(Location 3);
}
System.out.println(Location 4);
}
If an IOException occurs, what will be printed?
B. Location 2
C. Location 3
D. Location 4
Explanation:
Correct Answer: B,C,D 41 of 60
If the method func() is allowed to throw out the IOException, which declaration of this method can used?
B. public int func(int i) throw IOException
C. public int func(int i) throw Exception
D. public int func(int i) throws IOException
E. public int func(int i) throws Exception
Explanation:
Correct Answer: D,E 42 of 60
|||
Given the following expression:
String f = null;
Which of the following expressions will throw an exception?
10
B. f != null | f.length()>10
C. f == null || f.length()>10
D. f != null || f.length()>10
Explanation:
Correct Answer: A,B,D 43 of 60
编辑推荐:
温馨提示:因考试政策、内容不断变化与调整,长理培训网站提供的以上信息仅供参考,如有异议,请考生以权威部门公布的内容为准! (责任编辑:长理培训)
点击加载更多评论>>