Snippets tagged “interrupted-exception”
2 snippets use this tag.
- How do I make a delay in Java?Java
To make a delay in Java, you can use the Thread.sleep method which will pause the current thread for a specified number of milliseconds. Here's an example:
- I get exception when using Thread.sleep(x) or wait()Java
If you are getting an exception when using Thread.sleep(x) or wait(), it could be because one of these methods has been interrupted.