The following sections describe solutions to the preceding problems. Remember that there usually isn't just one correct way to solve a particular problem. Also, remember that the explanations shown here include only the most interesting and important details needed to solve the problems. Download the example solutions to see additional details and to experiment with the programs at https://github.com/PacktPublishing/Java-Coding-Problems.
Solutions
199. Thread life cycle states
The states of a Java thread are expressed via the Thread.State enumeration. The possible states of a Java thread are shown in the following diagram:
The different lifecycle states are as follows:
- The NEW state
- The RUNNABLE state
- The BLOCKED state...