問九:源碼層面解析Thread.sleep()爲什麼需要拋異常?

結合此篇文章進行閱讀:InterruptedExcption詳細分析 導入: Thread.sleep()拋的是InterruptedException,這個錯誤在源碼中的註釋爲: * Thrown when a thread is waiting, sleeping, or  otherwise occupied, * and the thread is interrupted, either
相關文章
相關標籤/搜索