首先是关于异常:
1 |
class ThreadTest2 implements Runnable{ |
如果要捕捉这样的异常,外部是捕捉不到的
1 |
try{ |
可以在run方法里面捕捉
1 |
class ThreadTest2 implements Runnable{ |
但是这样并不是很好的解决方法,虽然可以捕捉到,正常应该是实现UncaughtExceptionHandler接口
1 |
try{ |
就可以捕捉到了.
首先是关于异常:
1 |
class ThreadTest2 implements Runnable{ |
如果要捕捉这样的异常,外部是捕捉不到的
1 |
try{ |
可以在run方法里面捕捉
1 |
class ThreadTest2 implements Runnable{ |
但是这样并不是很好的解决方法,虽然可以捕捉到,正常应该是实现UncaughtExceptionHandler接口
1 |
try{ |
就可以捕捉到了.
近期评论