Java Exceptions MCQs with answers Page - 6

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 • 831.35K Points
Coach

Q. Can we catch Error in Java?

  • (A) Yes, but not recommended
  • (B) No, it’s not allowed
  • (C) Only in custom classes
  • (D) Only in Java 11+

A

Admin • 831.35K Points
Coach

Q. What is the default behavior when an exception occurs and is not caught?

  • (A) Continue execution
  • (B) Program hangs
  • (C) Program terminates
  • (D) Exception is ignored

A

Admin • 831.35K Points
Coach

Q. What does multi-catch block allow in Java 7+?

  • (A) Catching multiple unrelated exceptions
  • (B) Catching only one exception
  • (C) Throwing multiple exceptions
  • (D) Creating new exception types

A

Admin • 831.35K Points
Coach

Q. Which of these is NOT a feature of exception handling in Java?

  • (A) Separates error-handling code
  • (B) Improves program reliability
  • (C) Slows down execution permanently
  • (D) Can handle both checked and unchecked exceptions

A

Admin • 831.35K Points
Coach

Q. What is the result of dividing by zero using floating point in Java?

  • (A) Exception
  • (B) 0
  • (C) Infinity
  • (D) NaN

A

Admin • 831.35K Points
Coach

Q. Which exception is thrown when a thread is waiting or sleeping and is interrupted?

  • (A) InterruptedException
  • (B) SleepException
  • (C) ThreadException
  • (D) TimeoutException

A

Admin • 831.35K Points
Coach

Q. What is the correct way to declare a method that throws multiple exceptions?

  • (A) throws IOException, SQLException
  • (B) throw IOException, SQLException
  • (C) throws (IOException, SQLException)
  • (D) throws: IOException SQLException

A

Admin • 831.35K Points
Coach

Q. What happens if finally block has a return statement?

  • (A) It overrides previous return
  • (B) It is ignored
  • (C) It causes error
  • (D) It prints the return value

A

Admin • 831.35K Points
Coach

Q. Which method in Throwable is used to get the cause of exception?

  • (A) cause()
  • (B) getCause()
  • (C) getError()
  • (D) findCause()

A

Admin • 831.35K Points
Coach

Q. Can we have multiple finally blocks in Java?

  • (A) Yes
  • (B) No
  • (C) Only one finally and one catch
  • (D) Only in Java 15+
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