JAVA Exceptions In which of the following package Exception class exist? java.lang java.net java.io java.util java.file java.lang java.net java.io java.util java.file 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() Name-B None of these Compilation fails-Exception NullPointerException is not compatible with throws clause in Value-A Compilation succeed but no output printName() Name-B None of these Compilation fails-Exception NullPointerException is not compatible with throws clause in Value-A Compilation succeed but no output ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions What will be the output?class MyClass{ public String test(){ try{ System.out.print("One"); return ""; } finally{ System.out.print("Two"); } }}public class Test{ public static void main(String args[]){ MyClass m = new MyClass(); m.test(); }} Compilation Error One None of these One Two Two Compilation Error One None of these One Two Two ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Exception generated in try block is caught in ........... block. catch finally throw throws catch finally throw throws ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Which of the following blocks execute compulsorily whether exception is caught or not. finally catch throw throws finally catch throw throws 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 None of these ClassCastException IllegalStateException ArrayIndexOutOfBoundsException NumberFormatException None of these ClassCastException IllegalStateException ArrayIndexOutOfBoundsException ANSWER DOWNLOAD EXAMIANS APP