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 ClassCastException ArrayIndexOutOfBoundsException IllegalStateException None of these NumberFormatException ClassCastException ArrayIndexOutOfBoundsException IllegalStateException None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions The class at the top of exception class hierarchy is ................. Exception Object ArithmeticException Throwable Exception Object ArithmeticException Throwable ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Which keyword is used to specify the exception thrown by method? catch throws finally throw catch throws finally throw 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(); }} None of these One Compilation Error One Two Two None of these One Compilation Error One Two Two ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Exception generated in try block is caught in ........... block. catch throws finally throw catch throws finally throw 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(); }} 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 printName() Compilation succeed but no output Name-B Value-A ANSWER DOWNLOAD EXAMIANS APP