Which exception type must be explicitly handled or declared to be thrown in a method?

  • Checked exceptions
  • Errors
  • None of the above
  • Unchecked exceptions (Runtime)
In Java, checked exceptions (which extend the Exception class but not RuntimeException) must be explicitly handled or declared to be thrown in a method. This requirement ensures that the code handles potentially problematic situations.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *