我写了个测试程序,编译未通过,提示如下:
unreported exception java.lang.ClassNotFoundException;
must be caught or declared to be thrown
再在main()后加上throws Exception之后就正常了
这样做到底有什么好处?
...全文
2217打赏收藏
解释一下java的异常机制
我写了个测试程序,编译未通过,提示如下: unreported exception java.lang.ClassNotFoundException; must be caught or declared to be thrown 再在main()后加上throws Exception之后就正常了 这样做到底有什么好处?