Getting started with Java Threads – Part 2 : join() and sleep()

The thread class provides some methods to define the threads behavior. Two important methods to consider are: – join(), to make the other instanced threads to wait for it to day. You can provide a timeout as parameter. – sleep(); The sleep() method throws a checked exception called “InterruptedException”,each time the thread receives an interrupt […]