下面的代码执行没有任何歧义的编译错误,输出是“ ArithmeticException ”。伙计们可以帮助我知道原因。
class Test {
public static void main(String[] args) throws UnknownHostException, IOException {
testMetod(null);
}
// Overloaded method of parameter type Object
private static void testMetod(Object object) {
System.out.println("Object");
}
// Overloaded method of parameter type Exception
private static void testMetod(Exception e) {
System.out.println("Exception");
}
// Overloaded method of parameter type ArithmeticException
private static void testMetod(ArithmeticException ae) {
System.out.println("ArithmeticException");
}
}