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 false None of these true Compilation Error false None of these true ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions What happen in case of multiple catch blocks? None of these Either super or subclass can be caught first. The superclass exception cannot caught first. The superclass exception must be caught first. None of these Either super or subclass can be caught first. The superclass exception cannot caught first. The superclass exception must be caught first. ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions The class at the top of exception class hierarchy is ................. Throwable Exception ArithmeticException Object Throwable Exception ArithmeticException Object ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Predict the output:public class Test{ public static void main(String args[]){ try{ String arr[] = new String[10]; arr = null; arr[0] = "one"; System.out.print(arr[0]); }catch(Exception ex){ System.out.print("exception"); }catch(NullPointerException nex){ System.out.print("null pointer exception"); } }} None of these "exception" is printed. "null pointer exception" is printed. "one" is printed. Compilation fails saying NullPointerException has already been caught. None of these "exception" is printed. "null pointer exception" is printed. "one" is printed. Compilation fails saying NullPointerException has already been caught. 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. B and D A and C A and B B and C A and D B and D A and C A and B B and C A and D 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 None of these Two Compilation Error One Two One None of these Two ANSWER DOWNLOAD EXAMIANS APP