Q1: What will be the output of the program?
    int x = 0; 
    int y = 5 / x; 
catch (Exception e) 
catch (ArithmeticException ae) 
    System.out.println(' Arithmetic Exception'); 

A Exception

B Compilation fails.

C Arithmetic Exception

D finished

ANS:A - finished

Compilation fails because ArithmeticException has already been caught. ArithmeticException is a subclass of java.lang.Exception, by time the ArithmeticException has been specified it has already been caught by the Exception class.

img not found

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.