JAVA Exceptions try{ File f = new File("a.txt");}catch(Exception e){}catch(IOException io){}Is this code create new file name a.txt ? Compilation Error true false None of these Compilation Error true false None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Determine output of the following program code?public class Test{ public static void main(String args[]){ int i; try{ i = calculate(); System.out.println(i); }catch(Exception e){ System.out.println("Error occured"); } } static int calculate(){ return (7/2); }} Error occured Compilation Error 3.5 3 None of these Error occured Compilation Error 3.5 3 None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Which of the following blocks execute compulsorily whether exception is caught or not. finally throw catch throws finally throw catch throws 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(); }} Compilation fails-Exception NullPointerException is not compatible with throws clause in Value-A None of these Compilation succeed but no output Name-B printName() Compilation fails-Exception NullPointerException is not compatible with throws clause in Value-A None of these Compilation succeed but no output Name-B printName() ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions In which of the following package Exception class exist? java.util java.file java.io java.lang java.net java.util java.file java.io java.lang java.net 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 ArrayIndexOutOfBoundsException ClassCastException IllegalStateException None of these NumberFormatException ArrayIndexOutOfBoundsException ClassCastException IllegalStateException None of these ANSWER DOWNLOAD EXAMIANS APP