JAVA Exceptions Which of the following blocks execute compulsorily whether exception is caught or not. throws throw finally catch throws throw finally catch 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"); } }} "null pointer exception" is printed. None of these "exception" is printed. "one" is printed. Compilation fails saying NullPointerException has already been caught. "null pointer exception" is printed. None of these "exception" is printed. "one" is printed. Compilation fails saying NullPointerException has already been caught. ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Which exception is thrown when divide by zero statement executes? ArithmeticException None of these NullPointerException NumberFormatException ArithmeticException None of these NullPointerException NumberFormatException ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions In which of the following package Exception class exist? java.util java.io java.lang java.net java.file java.util java.io java.lang java.net java.file 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 IllegalStateException None of these ArrayIndexOutOfBoundsException ClassCastException NumberFormatException IllegalStateException None of these ArrayIndexOutOfBoundsException ClassCastException 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 One Two None of these Two Compilation Error One One Two None of these Two Compilation Error ANSWER DOWNLOAD EXAMIANS APP