JAVA Exceptions In which of the following package Exception class exist? java.net java.io java.file java.util java.lang java.net java.io java.file java.util java.lang 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); }} None of these Compile with error Prints out: Finally Prints out: Exception Finally Prints out: Exception None of these Compile with error Prints out: Finally Prints out: Exception Finally Prints out: Exception 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); }} 3 Error occured Compilation Error None of these 3.5 3 Error occured Compilation Error None of these 3.5 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 try{ File f = new File("a.txt");}catch(Exception e){}catch(IOException io){}Is this code create new file name a.txt ? None of these false true Compilation Error None of these false true Compilation Error ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Which keyword is used to explicitly throw an exception? try throw catch throwing try throw catch throwing ANSWER DOWNLOAD EXAMIANS APP