JAVA Exceptions In which of the following package Exception class exist? java.util java.lang java.file java.net java.io java.util java.lang java.file java.net java.io ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Which exception is thrown when an array element is accessed beyond the array size? ArrayIndexOutOfBounds ArrayElementOutOfBounds ArrayIndexOutOfBoundsException None of these ArrayIndexOutOfBounds ArrayElementOutOfBounds ArrayIndexOutOfBoundsException None of these 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(); }} Compilation fails-Exception NullPointerException is not compatible with throws clause in None of these Name-B Compilation succeed but no output Value-A printName() Compilation fails-Exception NullPointerException is not compatible with throws clause in None of these Name-B Compilation succeed but no output Value-A printName() ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Exception generated in try block is caught in ........... block. finally throw throws catch finally throw throws catch 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 ? true false Compilation Error None of these true false Compilation Error 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? NumberFormatException ArrayIndexOutOfBoundsException None of these ClassCastException IllegalStateException NumberFormatException ArrayIndexOutOfBoundsException None of these ClassCastException IllegalStateException ANSWER DOWNLOAD EXAMIANS APP