JAVA异常处理


把异常的错误信息输出在控制台
e.printStackTrace();
public String getMessage():返回此 throwable 的详细消息字符串
System.out.println(e.getMessage());
Index 3 out of bounds for length 3

public String toString():返回此可抛出的简短描述
System.out.println(e.toString());
java.lang.ArrayIndexOutOfBounds
Exception: Index 3 out of bounds for length 3

 

posted on 2020-10-21 13:32  bbhm  阅读(98)  评论(0编辑  收藏  举报

导航