Engineering Full Stack Apps with Java and JavaScript
Identify the correct constructs.
Select 1 option
A. try {
for( ;; );
}finally { }
B.try {
File f = new File("c:\a.txt");
} catch { f = null; }
C.int k = 0;
try {
k = callValidMethod();
}System.out.println(k);
catch { k = -1; }
D.try {
try {
Socket s = new ServerSocket(3030);
}catch(Exception e) {
s = new ServerSocket(4040);
}
}
E. try {
s = new ServerSocket(3030);
} catch(Exception t){ t.printStackTrace(); }
catch(IOException e) {
s = new ServerSocket(4040);
}catch(Throwable t){ t.printStackTrace(); }
F.int x = validMethod();
try {
if(x == 5) throw new IOException();
else if(x == 6) throw new Exception();
}finally {
x = 8;
}catch(Exception e){ x = 9; }