JAVA Exceptions Which keyword is used to specify the exception thrown by method? catch throws finally throw catch throws finally throw ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Which of the following blocks execute compulsorily whether exception is caught or not. finally throw catch throws finally throw catch throws ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Which exception is thrown when divide by zero statement executes? ArithmeticException NullPointerException None of these NumberFormatException ArithmeticException NullPointerException None of these NumberFormatException 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(); }} Compilation fails-Exception NullPointerException is not compatible with throws clause in Name-B None of these Compilation succeed but no output Value-A printName() Compilation fails-Exception NullPointerException is not compatible with throws clause in Name-B None of these Compilation succeed but no output Value-A printName() 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.5 Compilation Error None of these 3 Error occured 3.5 Compilation Error None of these 3 Error occured ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Exception generated in try block is caught in ........... block. finally throws catch throw finally throws catch throw ANSWER DOWNLOAD EXAMIANS APP