What will be the result of the following code:
public class Tester {
public static void main(String[] args) {
System.out.print("1");
try {
System.out.print("2");
System.exit(0);
} finally {
System.out.print("3");
}
}
}
Ans : 12 : System.exit(0) will cause the program to exit and finally block will not be executed
public class Tester {
public static void main(String[] args) {
System.out.print("1");
try {
System.out.print("2");
System.exit(0);
} finally {
System.out.print("3");
}
}
}
Ans : 12 : System.exit(0) will cause the program to exit and finally block will not be executed
No comments:
Post a Comment