JAVA Exceptions try{ File f = new File("a.txt");}catch(Exception e){}catch(IOException io){}Is this code create new file name a.txt ? true false None of these Compilation Error true false None of these Compilation Error ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Which exception is thrown when divide by zero statement executes? ArithmeticException NumberFormatException NullPointerException None of these ArithmeticException NumberFormatException NullPointerException None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Given the code. What is the result when this program is executed?public class Test{ static int x[]; static{ x[0] = 1; } public static void main(String args[]){ }} StackOverflowException is thrown ArrayIndexOutOfBoundsException is thrown IllegalStateException is thrown ExceptionInInitializerError is thrown None of these StackOverflowException is thrown ArrayIndexOutOfBoundsException is thrown IllegalStateException is thrown ExceptionInInitializerError is thrown None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions What will be the result of executing the following code?public class Test{ public void divide(int a, int b){ try{ int c = a / b; }catch(Exception e){ System.out.print("Exception "); }finally{ System.out.println("Finally"); } public static void main(String args[]){ Test t = new Test(); t.divide(0,3); }} Compile with error Prints out: Exception Finally Prints out: Finally Prints out: Exception None of these Compile with error Prints out: Exception Finally Prints out: Finally Prints out: Exception None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Which of the below statement is/are true about Error?A. An Error is a subclass of Throwable.B. An Error is a subclass of Exception.C. Error indicates serious problems that a reasonable application should not try to catch.D. An Error is a subclass of IOException. A and C A and B A and D B and C B and D A and C A and B A and D B and C B and D ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions What will be the output of the following piece of code:class Person{ public void talk() {}}public class Test{ public static void main(String args[]){ Person p = null; try{ p.talk(); } catch(NullPointerException e){ System.out.print("There is a NullPointerException. "); } catch(Exception e){ System.out.print("There is an Exception. "); } System.out.print("Everything went fine. "); }} There is a NullPointerException. There is a NullPointerException. There is an Exception. There is a NullPointerException. Everything went fine. This code will not compile, because in Java there are no pointers. There is a NullPointerException. There is a NullPointerException. There is an Exception. There is a NullPointerException. Everything went fine. This code will not compile, because in Java there are no pointers. ANSWER DOWNLOAD EXAMIANS APP