JAVA Exceptions Which exception is thrown when an array element is accessed beyond the array size? None of these ArrayIndexOutOfBoundsException ArrayIndexOutOfBounds ArrayElementOutOfBounds None of these ArrayIndexOutOfBoundsException ArrayIndexOutOfBounds ArrayElementOutOfBounds ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Determine output of the following program code?public class Test{ public static void main(String args[]){ int i; try{ i = calculate(); System.out.println(i); }catch(Exception e){ System.out.println("Error occured"); } } static int calculate(){ return (7/2); }} Compilation Error 3.5 Error occured None of these 3 Compilation Error 3.5 Error occured None of these 3 ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Which keyword is used to explicitly throw an exception? throw throwing try catch throw throwing try catch 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. The superclass exception cannot caught first. None of these The superclass exception must be caught first. Either super or subclass can be caught first. The superclass exception cannot caught first. None of these 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? IllegalStateException None of these NumberFormatException ArrayIndexOutOfBoundsException ClassCastException IllegalStateException None of these NumberFormatException ArrayIndexOutOfBoundsException ClassCastException 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(); }} printName() Compilation succeed but no output Name-B Value-A None of these Compilation fails-Exception NullPointerException is not compatible with throws clause in printName() Compilation succeed but no output Name-B Value-A None of these Compilation fails-Exception NullPointerException is not compatible with throws clause in ANSWER DOWNLOAD EXAMIANS APP