14 lines
376 B
Java
14 lines
376 B
Java
public class StackTrace {
|
|
|
|
public static void main(String[] args) {
|
|
System.out.println("begin.");
|
|
new RuntimeException("test").printStackTrace();
|
|
|
|
System.out.println("finish.");
|
|
new RuntimeException("test1").printStackTrace(System.out);
|
|
|
|
System.out.println("exit");
|
|
throw new RuntimeException("test2");
|
|
}
|
|
}
|