Test Your Knowledge
Test your understanding of exceptions.
We'll cover the following...
We'll cover the following...
Technical Quiz
1.
What will be the result of the code when executed?
class Exceptions {
public static void main( String args[] ) {
try{
throw new ArithmeticException();
}catch(Exception e){
System.out.println("Catch");
throw new NullPointerException();
}finally{
System.out.println("Finally");
throw new NumberFormatException();
}
}
}
A.
Prints Catch
and Finally
B.
Prints Catch
and NumberFormatException
C.
Prints the NumberFormatException
D.
Prints Catch
and Finally
and the NumberFormatException
1 / 7