Question ID: UK8294645
Given code of Test.java file:
package com.examtest.ocp;
import java.io.IOException;
import java.sql.SQLException;
class MyResource implements AutoCloseable {
@Override
public void close() throws IOException{
throw new IOException("IOException");
}
public void execute() throws SQLException {
throw new SQLException("SQLException");
}
}
public class Test {
public static void main(String[] args) {
try(MyResource resource = new MyResource()) {
resource.execute();
} catch(Exception e) {
System.out.println(e.getMessage());
}
}
}
What is the result?