Machine-translated by Google. Questions are authored in English.
Top

Discussion

Which of these exception types is checked?

  • A.IllegalMonitorStateException
  • B.IllegalThreadStateException
  • C.IllegalArgumentException
  • D.InterruptedException

Answer: D

InterruptedException extends Exception, so it must be caught or declared, which is why every call to sleep or join needs a try block. The other three extend RuntimeException and are unchecked, so the compiler says nothing about them.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.