JAVA Exceptions Which exception is thrown when an array element is accessed beyond the array size? ArrayIndexOutOfBounds ArrayElementOutOfBounds None of these ArrayIndexOutOfBoundsException ArrayIndexOutOfBounds ArrayElementOutOfBounds None of these ArrayIndexOutOfBoundsException 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. None of these "null pointer exception" is printed. "one" is printed. "exception" is printed. Compilation fails saying NullPointerException has already been caught. None of these "null pointer exception" is printed. "one" is printed. ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions What happen in case of multiple catch blocks? The superclass exception must be caught first. None of these The superclass exception cannot caught first. Either super or subclass can be caught first. The superclass exception must be caught first. None of these The superclass exception cannot caught first. Either super or subclass can be caught first. 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. A and B B and D A and D A and C B and C A and B B and D A and D A and C B and C ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions try{ File f = new File("a.txt");}catch(Exception e){}catch(IOException io){}Is this code create new file name a.txt ? None of these Compilation Error false true None of these Compilation Error false true ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions The class at the top of exception class hierarchy is ................. ArithmeticException Throwable Object Exception ArithmeticException Throwable Object Exception ANSWER DOWNLOAD EXAMIANS APP