JAVA Exceptions Which exception is thrown when divide by zero statement executes? ArithmeticException NumberFormatException None of these NullPointerException ArithmeticException NumberFormatException None of these NullPointerException 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 "one" is printed. Compilation fails saying NullPointerException has already been caught. "null pointer exception" is printed. "exception" is printed. None of these "one" is printed. Compilation fails saying NullPointerException has already been caught. "null pointer exception" is printed. "exception" is printed. ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Which of the following blocks execute compulsorily whether exception is caught or not. throw finally catch throws throw finally catch throws ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions What happen in case of multiple catch blocks? The superclass exception must be caught first. None of these The superclass exception cannot caught first. Either super or subclass can be caught first. The superclass exception must be caught first. None of these The superclass exception cannot caught first. Either super or subclass can be caught first. 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"); } }} The program will return without printing anything inFinallyBlock inCatchBlock inFinallyBlock inCatchBlock The program will return without printing anything inFinallyBlock inCatchBlock inFinallyBlock inCatchBlock ANSWER DOWNLOAD EXAMIANS APP
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