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