Java SE 8 Programmer II (1Z0-809)
© examsiri.com
Question : 3 of 8
Marks:
+1,
-0
Given the code fragment:
What is the result?
class MyResource1 implements AutoCloseable {
public void close() throws IOException {
System.out.print("1 ");
}
}
class MyResource2 implements Closeable {
public void close() throws IOException {
throw new IOException();
} }
public class TestRes {
public static void main(String[] args) {
try (MyResource1 r1 = new MyResource1();
MyResource2 r2 = new MyResource2();) {
System.out.print("T ");
} catch (IOException ioe) {
System.out.print("IOE ");
} finally {
System.out.print("F ");
}
} } What is the result?
Go to Question: