JAVA Exceptions Exception generated in try block is caught in ........... block. finally throw catch throws finally throw catch throws ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions In which of the following package Exception class exist? java.net java.io java.file java.lang java.util java.net java.io java.file java.lang java.util 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 Two One Two None of these Compilation Error One Two One Two None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Which of the following blocks execute compulsorily whether exception is caught or not. throws finally catch throw throws finally catch throw 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 ClassCastException ArrayIndexOutOfBoundsException None of these NumberFormatException IllegalStateException ClassCastException ArrayIndexOutOfBoundsException None of these NumberFormatException 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 Value-A None of these printName() Compilation succeed but no output Compilation fails-Exception NullPointerException is not compatible with throws clause in Name-B Value-A None of these printName() Compilation succeed but no output Compilation fails-Exception NullPointerException is not compatible with throws clause in ANSWER DOWNLOAD EXAMIANS APP