What does the `Thread.interrupt()` method do in Java?
`Thread.interrupt()` sends an interrupt signal to a thread, which can be used to stop or pause the thread's execution depending on how it is handled.
Correct! `Thread.interrupt()` signals the thread to stop or handle the interruption, depending on how the thread responds to it.
Can you explain how a thread can respond to an interrupt signal? What happens if it is blocked in a method like `sleep()` or `wait()`?