InstructionsTotal Questions: 27Total Minutes: 27This ExamTray Free Online Test or Quiz or Trivia tests your Programming Skills on the basics of Java Exception Handling. This practice test displays answers after finishing the exam for review. You can easily clear Competitive Exams and Job Interview Questions. Students can learn Java basics. Go through Java Theory Notes on Exception Handling before attempting this test. All the Best Challenge SCORE0 / 27Take This Exam 1*2*3*4*5*6*7*8*9*10*11*12*13*14*15*16*17*18*19*20*21*22*23*24*25*26*27*Q Buttons 1) What is an Exception in Java? A) An exception is like a generic error error occurring during the time of execution of program B) An exception may occur due to memory or hardware issues C) An exception leads to bad experience for an End user of the software D) All the above 2) All Java exceptions can be handled gracefully. State TRUE or FALSE. A) TRUE B) FALSE C) - D) - 3) Are the classes Error and Exception similar in Java? A) No B) YES C) - D) - 4) Which is the super class in Java that bundles all classes to deal with exceptions and errors? A) Error B) Exception C) Throwable D) Throw 5) Which are the keywords used to handle exceptions in Java? A) TRY, CATCH B) FINALLY C) THROW, THROWS D) All the above 6) Where should you keep your Java code for checking against runtime exceptions? A) Inside TRY block B) Inside CATCH block C) inside FINALLY block D) All the above 7) Where should you keep your Java code that helps to take action on the exceptions raised inside TRY block? A) One more TRY block B) CATCH block C) FINALLY block D) None of the above Ad 8) What is the output of the below Java code with Exceptions? public class ExceptionTest1 { public static void main(String[] args) { try { int a=9, b=0; int c = a/b; System.out.println("Exception occurred."); } catch(Exception e) { System.out.println("Catching an Exception."); } } } A) Exception occurred. Catching an Exception. B) Exception occurred. C) Catching an Exception. D) No output 9) If an exception occurs, all the lines of Java code that is below it stops executing. State TRUE or FALSE. A) TRUE B) FALSE C) - D) - 10) Java exceptions are handled by ____. A) Java Compiler B) Java Runtime C) - D) - 11) Can you add more than one CATCH block when handling exceptions in Java? A) YES B) NO C) - D) - 12) A TRY block is the reason for generating a manual exception or an unexpected Runtime exception. State TRUE or FALSE. A) TRUE B) FALSE C) - D) - 13) What is the output of the below Java code with Exceptions? public class ExceptionTest2 { public static void main(String[] args) { try { int ary[] = {10, 20, 30}; int tempt = ary[4]; } catch(ArrayIndexOutOfBoundsException e1) { System.out.println(e1.getMessage()); } catch(Exception e2) { System.out.println("Some exception"); } } } A) Index 4 out of bounds for length 3 B) Index 4 out of bounds for length Some exception C) Some exception D) No exception occurs 14) Choose the correct way of writing multiple CATCH blocks in Java. A) try { int num = 10/0; } catch(Exception e1) { System.out.println("EXCEPTION"); } catch(ArithmeticException e2) { System.out.println("ARITHMETIC EXCEPTION"); } B) try { int num = 10/0; } catch(ArithmeticException e2) { System.out.println("ARITHMETIC EXCEPTION"); } catch(Exception e1) { System.out.println("EXCEPTION"); } C) - D) - Ad 15) Where do you keep the Java code that should be executed at all times even if an exception occurs? A) inside TRY block B) inside CATCH block C) inside FINALLY block D) All the above 16) What is the output of the below java code with exception handling blocks? public class ExceptionTest4 { public static void main(String[] args) { try { } catch(Exception e) { } finally { System.out.println("FINALLY block executed"); } } } A) No output B) FINALLY block executed C) Compiler error D) None 17) What is the output of the below Java code with exception handling blocks? public class ExceptionTest5 { public static void main(String[] args) { int ary[] = new int[2]; ary[10] = 5; try { int number= 2/0; } catch(Exception e) { System.out.println("Divide by Zero"); } finally { System.out.println("Inside FINALLY block"); } } } A) Inside FINALLY block B) Divide by Zero Inside FINALLY block C) Compiler error D) No output 18) What is the output of the Java code with FINALLY block and RETURN statement? public class ExceptionTest6 { static void show() { try { System.out.println("inside TRY"); return; } finally { System.out.println("inside FINALLY"); } } public static void main(String[] args) { show(); } } A) inside TRY B) inside TRY inside FINALLY C) inside FINALLY D) Compiler error 19) Choose the correct way of writing TRY CATCH FINALLY blocks in Java. A) try{} catch{} finally{} B) try{} finally{} C) try{} catch{} D) All the above 20) The FINALLY block should always be accompanied by a ___ block in Java. A) TRY B) CATCH C) FINALLY D) None 21) The CATCH block should always be accompanied by a ____ block in Java. A) TRY B) CATCH C) FINALLY D) None Ad 22) How many extra TRY blocks may be present with an existing TRY block in Java? A) 0 B) 1 C) 2 D) 3 23) How many CATCH blocks may be present in try-catch-finally series of blocks in Java? A) 1 B) 2 C) 3 D) any number of catch blocks 24) What is an Unchecked Exception in Java? A) An exception that need not be handled B) An exception that may be declared without compiler error C) Exceptions which will ignored by the compiler for not catching or for throwing D) All the above 25) What is a Checked Exception in Java? A) An exception which should be thrown inside the method along with declaring that the method throws it. B) An exception which should be handled using TRY CATCH statements. C) Exceptions for which the compiler throws error without completing compilation for not handling properly D) All the above 26) Choose which are Java unchecked exceptions below? A) NullPointerException, ArithmeticException B) IndexOutOfBoundException, ArrayIndexOutOfBoundsException C) IllegalArgumentException, StringIndexOutOfBoundsException D) All the above 27) Choose which are Java checked exceptions below? A) ClassNotFoundException B) NoSuchMethodException, NoSuchFieldException C) InterrruptedException, IllegalAccessException D) All the above FINISH EXAM 1*2*3*4*5*6*7*8*9*10*11*12*13*14*15*16*17*18*19*20*21*22*23*24*25*26*27*PREV Java Access Modifiers Online Test NEXT Java Exception Handling Online Test 2 Certification Group ID 0