black

SCJP程序员认证考试

登录

单项选择题

import java.io.IOException; 
public class ExceptionTest( 
public static void main (String[]args) 
try ( 
methodA(); 
) catch (IOException e)  ( 
system.out.printIn(“Caught IOException”); 
) catch (Exception e)   ( 
system.out.printIn(“Caught Exception”); 
) 
) 
public void methodA ()   { 
throw new IOException (); 
}  
What is the result?() 

A. The code will not compile.
B. The output is caught exception.
C. The output is caught IOException.
D. The program executes normally without printing a message.

相关考题

单项选择题 public class foo {  public static void main (string[]args)  try {return;}  finally {system.out.printIn(“Finally”);}  }  What is the result?()

多项选择题 switch (i)  {  default:  System.out.printIn(“Hello”);  )   What are the two acceptable types for the variable i?()

单项选择题 int i= 1, j= 10 ;  do (  if (i++> --j) continue;  ) while (i<5);   After execution, what are the values for I and j?()

All Rights Reserved 版权所有©建筑考试题库(jzkao.com)

备案号:湘ICP备2020024380号-3