JAVA Exceptions Exception generated in try block is caught in ........... block. throw finally catch throws throw finally 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 None of these 3.5 3 Error occured Compilation Error None of these 3.5 3 Error occured 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: Finally Prints out: Exception Finally None of these Prints out: Exception Compile with error Prints out: Finally Prints out: Exception Finally None of these Prints out: Exception Compile with error 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. A and C A and D B and C B and D A and B A and C A and D B and C B and D A and B ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions What is the output for the below code ?import java.io.FileNotFoundException;class A{ public void printName() throws FileNotFoundException{ System.out.println("Value-A"); }}class B extends A{ public void printName() throws NullPointerException{ System.out.println("Name-B"); }}public class Test{ public static void main (String[] args) throws Exception{ A a = new B(); a.printName(); }} Name-B Compilation succeed but no output Value-A None of these Compilation fails-Exception NullPointerException is not compatible with throws clause in printName() Name-B Compilation succeed but no output Value-A None of these Compilation fails-Exception NullPointerException is not compatible with throws clause in printName() ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions In which of the following package Exception class exist? java.io java.file java.net java.util java.lang java.io java.file java.net java.util java.lang ANSWER DOWNLOAD EXAMIANS APP