Thread Class and the Runnable Interface:
Java's multithreading system is built upon the Thread class, its methods and its companion interfaces, Runnable, Thread encapsulated a thread of execution. Because you can not directly refer to the ethereal state of a running thread, you will deal along with it through its proxy, the Thread example which spawned it. For create a new thread, your program will either extend Thread implement the Runnable interface.
Method Description
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.
Therefore far, the entire instance in this book has used a single thread of execution. A remainder of this lesson elaborate how to use Thread and Runnable to create and maintain threads, starting along with the one thread in which all Java programs have: the main thread.