public class ThrowOut {
public static void
main(String[] args) throws Throwable {
try {
throw new Throwable();
} catch(Exception e) {
System.err.println("Caught in main()");
}
}
} ///:~
这个错在哪里? 说明下原因,谢谢。
public static void
main(String[] args) throws Throwable {
try {
throw new Throwable();
} catch(Exception e) {
System.err.println("Caught in main()");
}
}
} ///:~
这个错在哪里? 说明下原因,谢谢。
是非常常见的做法。接口不能new
类 Throwable
java.lang.Object
java.lang.Throwable
所有已实现的接口:
Serializable
直接已知子类:
Error, Exception 这个不是借口好不?