JAVA Exceptions In which of the following package Exception class exist? java.io java.lang java.util java.file java.net java.io java.lang java.util java.file java.net 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"); } }} Compilation fails saying NullPointerException has already been caught. "one" is printed. "null pointer exception" is printed. None of these "exception" is printed. Compilation fails saying NullPointerException has already been caught. "one" is printed. "null pointer exception" is printed. None of these "exception" is printed. ANSWER DOWNLOAD EXAMIANS APP
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 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 Two One Two None of these One Compilation Error Two One Two None of these One 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 B and C A and B A and D A and C B and D B and C A and B A and D A and C ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions What is the output of the following program code?public class Test{ public static void main(String args[]){ try{ int i; return; } catch(Exception e){ System.out.print("inCatchBlock"); } finally{ System.out.println("inFinallyBlock"); } }} inCatchBlock inFinallyBlock inFinallyBlock inCatchBlock The program will return without printing anything inCatchBlock inFinallyBlock inFinallyBlock inCatchBlock The program will return without printing anything ANSWER DOWNLOAD EXAMIANS APP