Java NetBeans project ***please showsolution****
public class TestClass {
public static voidmain(String[] args) throws A {
try {
f();
} finally {
System.out.println(“Done.”);
} catch (Exception1 e){
throw e;
}
}
}
public class Exception1 extendsThrowable{}
Test Stem / Question
Choices
What is the problem with the above code?
A: The finally statement must be preceeded by the catchclause
B: Exceptions cannot be extended
C: It is illegal to throw an exception
D: Nothing is wrong
What should be done with the code?
A: Move the catch clause before the finally clause.
B: Do not use Throwable as the supertype of
PayPal Gateway not configured
PayPal Gateway not configured