JAVA Exceptions Exception generated in try block is caught in ........... block. throw catch throws finally throw catch throws finally ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Which keyword is used to specify the exception thrown by method? finally throw catch throws finally throw catch throws ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Determine output of the following program code?public class Test{ public static void main(String args[]){ int i; try{ i = calculate(); System.out.println(i); }catch(Exception e){ System.out.println("Error occured"); } } static int calculate(){ return (7/2); }} Compilation Error 3 None of these 3.5 Error occured Compilation Error 3 None of these 3.5 Error occured 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 ClassCastException ArrayIndexOutOfBoundsException IllegalStateException None of these NumberFormatException ClassCastException ArrayIndexOutOfBoundsException IllegalStateException None of these 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 inCatchBlock inFinallyBlock The program will return without printing anything inFinallyBlock inCatchBlock inCatchBlock inFinallyBlock 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); }} Prints out: Exception Finally Prints out: Finally Compile with error Prints out: Exception None of these Prints out: Exception Finally Prints out: Finally Compile with error Prints out: Exception None of these ANSWER DOWNLOAD EXAMIANS APP