JAVA Exceptions Which exception is thrown when divide by zero statement executes? NumberFormatException NullPointerException ArithmeticException None of these NumberFormatException NullPointerException ArithmeticException None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions What will be the output?class MyClass{ public String test(){ try{ System.out.print("One"); return ""; } finally{ System.out.print("Two"); } }}public class Test{ public static void main(String args[]){ MyClass m = new MyClass(); m.test(); }} Compilation Error One None of these Two One Two Compilation Error One None of these Two One Two ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Which keyword is used to specify the exception thrown by method? catch throws throw finally catch throws throw finally ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Predict the output:public class Test{ public static void main(String args[]){ try{ String arr[] = new String[10]; arr = null; arr[0] = "one"; System.out.print(arr[0]); }catch(Exception ex){ System.out.print("exception"); }catch(NullPointerException nex){ System.out.print("null pointer exception"); } }} "one" is printed. "null pointer exception" is printed. "exception" is printed. Compilation fails saying NullPointerException has already been caught. None of these "one" is printed. "null pointer exception" is printed. "exception" is printed. Compilation fails saying NullPointerException has already been caught. None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions What happen in case of multiple catch blocks? The superclass exception must be caught first. The superclass exception cannot caught first. Either super or subclass can be caught first. None of these The superclass exception must be caught first. The superclass exception cannot caught first. Either super or subclass can be caught first. None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions The class at the top of exception class hierarchy is ................. Throwable Exception Object ArithmeticException Throwable Exception Object ArithmeticException ANSWER DOWNLOAD EXAMIANS APP