s*****p 发帖数: 7 | 1 As far as I understand, a method can "throws" exceptions to be handled by its
caller. But I just found an example like this:
public class Test {
public static void main(String[] args)
throws InterruptedException {
......
Thread.sleep();
}
}
I just wonder that who will handle the exception "throws" by the main().
Thank you very much. | h**j 发帖数: 2033 | 2 JVM
【在 s*****p 的大作中提到】 : As far as I understand, a method can "throws" exceptions to be handled by its : caller. But I just found an example like this: : public class Test { : public static void main(String[] args) : throws InterruptedException { : ...... : Thread.sleep(); : } : } :
|
|