问题:
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; }
}
结果为:()
A . 42
B . 编译失败
C . 无输出结果
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; }
}
结果为:()
● 参考解析
本题暂无解析