Java Exceptions MCQs with answers Page - 1

You will find multiple-choice questions (MCQs) related to #Java Exceptions here. Go through these questions to prepare effectively for your upcoming exams and interviews.

To view the correct answer for any question, simply click the "Show Answer" button.

Have a question to share? Click on "Add Question" to contribute!

A

Admin • 802.91K Points
Coach

Q. Exception created by try block is caught in which block

  • (A) catch
  • (B) throw
  • (C) final
  • (D) none

A

Admin • 802.91K Points
Coach

Q. What is the superclass of all exceptions in Java?

  • (A) Exception
  • (B) Throwable
  • (C) RuntimeException
  • (D) Error

A

Admin • 802.91K Points
Coach

Q. Which of the following is an unchecked exception?

  • (A) IOException
  • (B) FileNotFoundException
  • (C) ArithmeticException
  • (D) InterruptedException

A

Admin • 802.91K Points
Coach

Q. What is the purpose of the `finally` block?

  • (A) To handle exceptions
  • (B) To execute code after try/catch
  • (C) To catch only runtime exceptions
  • (D) None of the above

A

Admin • 802.91K Points
Coach

Q. Which keyword is used to manually throw an exception?

  • (A) throws
  • (B) throw
  • (C) catch
  • (D) try

A

Admin • 802.91K Points
Coach

Q. What happens if an exception is not caught?

  • (A) Program continues
  • (B) It is ignored
  • (C) Program terminates abnormally
  • (D) It is logged automatically

A

Admin • 802.91K Points
Coach

Q. Which block is always executed whether an exception occurs or not?

  • (A) try
  • (B) catch
  • (C) finally
  • (D) throw

A

Admin • 802.91K Points
Coach

Q. Which exception is thrown when a number is divided by zero?

  • (A) NullPointerException
  • (B) IOException
  • (C) ArithmeticException
  • (D) IllegalArgumentException

A

Admin • 802.91K Points
Coach

Q. Which of these is a checked exception?

  • (A) NullPointerException
  • (B) IOException
  • (C) ArithmeticException
  • (D) ArrayIndexOutOfBoundsException

A

Admin • 802.91K Points
Coach

Q. What does `throws` keyword indicate?

  • (A) Throw an exception
  • (B) Catch an exception
  • (C) Declare an exception
  • (D) Handle an exception
What's Tag

As you may know, questions are organized under broad categories. Each category can include various types of questions. For example, the "History" category might contain questions about the Revolt of 1857, Shivaji Maharaj, Ancient History, Buddhism, and more.

To further refine this organization, we've introduced tags, which act as sub-categories to group questions more specifically.

Verified users can add tags to any question. If you have any suggestions regarding this system, we'd love to hear from you. Contact Us

Learn More