throwable classのメソッドprintStackTrace
public class Outer {
public static void main(String[] args) {
String s = null;
try {
s.charAt(0);
} catch (Exception e) {
e.printStackTrace();
}
}
}
java.lang.NullPointerException
at com.mycompany.mavenproject1.Outer.main(Outer.java:23)