What type of exception is thrown by the `sleep()` method?

  1. IOException
  2. InterruptedException
  3. ArithmeticException
  4. IllegalArgumentException
Correct answer InterruptedException

Explanation

The `Thread.sleep()` method throws `InterruptedException`.

Update: Admin added a tag on this question

Topics

By Admin · · 32 views