black

Java认证考试综合练习

登录

单项选择题

class Parser extends Utils { 
public static void main
(String [] args) { 
try { System.out.print(new Parser().getInt("42")); 
} catch (NumberFormatException n) { 
System.out.println("NFExc "); } 
} 
int getInt(String arg) throws NumberFormatException { 
return Integer.parseInt(arg); 
} 
} 
class Utils { 
int getInt(String arg) { return 42; } 
} 
结果为:() 

A.42
B.NFExc
C.42NFExc
D.编译失败

相关考题

单项选择题 class Parser extends Utils {  public static void main(String [] args) {   System.out.print(new Parser().getInt("42"));  }  int getInt(String arg) {  return Integer.parseInt(arg);  }  }  class Utils {  int getInt(String arg) throws Exception { return 42; }  }  结果为:()

单项选择题 class Top {  static int x = 1;  public Top(int y) { x *= 3; }  }  class Middle extends Top {  public Middle() { x += 1; }  public static void main(String [] args) {  Middle m = new Middle();  System.out.println(x);  }  }  结果为:()

单项选择题 t 是一个合法的 Thread 对象的引用,并且 t 的合法 run() 方法如下:  public void run() {  System.out.print("go ");  }  及:   t.start();  t.start();  t.run();  哪一个是结果?()

All Rights Reserved 版权所有©求知题库网库(csqiuzhi.com)

备案号:湘ICP备14005140号-1

经营许可证号:湘B2-20140064