JAVA Exceptions The class at the top of exception class hierarchy is ................. Exception Throwable ArithmeticException Object Exception Throwable ArithmeticException Object ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Which exception is thrown when an array element is accessed beyond the array size? ArrayElementOutOfBounds None of these ArrayIndexOutOfBounds ArrayIndexOutOfBoundsException ArrayElementOutOfBounds None of these ArrayIndexOutOfBounds ArrayIndexOutOfBoundsException ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions What is the output for the below code ?import java.io.FileNotFoundException;class A{ public void printName() throws FileNotFoundException{ System.out.println("Value-A"); }}class B extends A{ public void printName() throws NullPointerException{ System.out.println("Name-B"); }}public class Test{ public static void main (String[] args) throws Exception{ A a = new B(); a.printName(); }} Name-B Value-A Compilation succeed but no output None of these Compilation fails-Exception NullPointerException is not compatible with throws clause in printName() Name-B Value-A Compilation succeed but no output None of these Compilation fails-Exception NullPointerException is not compatible with throws clause in printName() ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions What is the output of the following program code?public class Test{ public static void main(String args[]){ try{ int i; return; } catch(Exception e){ System.out.print("inCatchBlock"); } finally{ System.out.println("inFinallyBlock"); } }} The program will return without printing anything inCatchBlock inCatchBlock inFinallyBlock inFinallyBlock The program will return without printing anything inCatchBlock inCatchBlock inFinallyBlock inFinallyBlock 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? ArrayIndexOutOfBoundsException None of these NumberFormatException ClassCastException IllegalStateException ArrayIndexOutOfBoundsException None of these NumberFormatException ClassCastException IllegalStateException ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions What happen in case of multiple catch blocks? The superclass exception cannot caught first. The superclass exception must be caught first. None of these Either super or subclass can be caught first. The superclass exception cannot caught first. The superclass exception must be caught first. None of these Either super or subclass can be caught first. ANSWER DOWNLOAD EXAMIANS APP