JAVA Exceptions Which keyword is used to explicitly throw an exception? try throw throwing catch try throw throwing catch ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions public class Test{ public static void main(String args[]){ try{ int a = Integer.parseInt("four"); } }}Which exception could be handled by the catch block for above? NumberFormatException ClassCastException ArrayIndexOutOfBoundsException None of these IllegalStateException NumberFormatException ClassCastException ArrayIndexOutOfBoundsException None of these IllegalStateException ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Which keyword is used to specify the exception thrown by method? throw finally catch throws throw finally catch throws ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Which of the below statement is/are true about Error?A. An Error is a subclass of Throwable.B. An Error is a subclass of Exception.C. Error indicates serious problems that a reasonable application should not try to catch.D. An Error is a subclass of IOException. B and D A and B A and C A and D B and C B and D A and B A and C A and D B and C ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions What happen in case of multiple catch blocks? The superclass exception must be caught first. Either super or subclass can be caught first. None of these The superclass exception cannot caught first. The superclass exception must be caught first. Either super or subclass can be caught first. None of these The superclass exception cannot caught first. 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"); } }} "exception" is printed. Compilation fails saying NullPointerException has already been caught. "null pointer exception" is printed. None of these "one" is printed. "exception" is printed. Compilation fails saying NullPointerException has already been caught. "null pointer exception" is printed. None of these "one" is printed. ANSWER DOWNLOAD EXAMIANS APP