12345678910



Question 1: We know that the method printStackTrace of an exception prints the stack of methods that have been call when that exception has ocurred. What stack trace will be printed after calling method1?
public void method1() throws Exception {
method2();
}

public void method2() throws Exception {
throw method3();
}

public Exception method3() {
return new Exception();
}

1. Exception in thread "main" java.lang.Exception
at mypackage.MyClass.method3(MyClass.java:30)
2. Exception in thread "main" java.lang.Exception
at mypackage.MyClass.method2(MyClass.java:20)
3. Exception in thread "main" java.lang.Exception
at mypackage.MyClass.method1(MyClass.java:10)