单项选择题
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.编译失败