getCause()、e.getMessage()产生的结果

(1)e.getMessage() 

e.getMessage(); 只会获得具体的异常名称. 比如说NullPoint 空指针,就告诉你说是空指针... 

 (2)e.getCause()

(3)e.getCause().getMessage();

这样的话就会获取到错误原因

猜你喜欢

转载自blog.csdn.net/qq_36826506/article/details/82463137