JAVA Exceptions Which of the following blocks execute compulsorily whether exception is caught or not. finally throw throws catch finally throw throws catch 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(); }} One Two Two None of these Compilation Error One One Two Two None of these Compilation Error One 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 None of these Compilation succeed but no output Compilation fails-Exception NullPointerException is not compatible with throws clause in printName() Value-A Name-B None of these Compilation succeed but no output Compilation fails-Exception NullPointerException is not compatible with throws clause in printName() Value-A ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Which exception is thrown when divide by zero statement executes? None of these NullPointerException NumberFormatException ArithmeticException None of these NullPointerException NumberFormatException ArithmeticException ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Which keyword is used to specify the exception thrown by method? throws throw finally catch throws throw finally catch ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Exception generated in try block is caught in ........... block. catch throw finally throws catch throw finally throws ANSWER DOWNLOAD EXAMIANS APP