When does Java's Thread.sleep throw InterruptedException?

后端 未结 6 808
青春惊慌失措
青春惊慌失措 2020-11-27 13:32

When does Java\'s Thread.sleep throw InterruptedException? Is it safe to ignore it? I am not doing any multithreading. I just want to wait for a few seconds before retryi

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-27 13:53

    The InterruptedException is usually thrown when a sleep is interrupted.

提交回复
热议问题