Java's multithreading system is built upon the Thread class and interface Runnable.
Thread encapsulates a thread of execution.
To create a new thread, your program will either extend Thread or implement the Runnable interface.
The Thread class defines several methods that help manage threads.
| Method | Meaning |
|---|---|
| getName | Obtain a thread's name. |
| getPriority() | Obtain a thread's priority. |
| isAlive() | Determine if a thread is still running. |
| join | Wait for a thread to terminate. |
| run | Entry point for the thread. |
| sleep | Suspend a thread for a period of time. |
| start | Start a thread by calling its run method. |