java.lang.Runnable
None
None
java.lang.Thread
JDK 1.0 or later
The Runnable interface declares the run() method that is required for use with the Thread class. Any class that implements the Runnable interface must define a run() method. This method is the top-level code that is run by a thread.
public interface java.lang.Runnable { // Methods public abstract void run(); }
When a Thread object starts running a thread, it associates executable code with the thread by calling a Runnable object's run() method. The subsequent behavior of the thread is controlled by the run() method. Thus, a class that wants to perform certain operations in a separate thread should implement the Runnable interface and define an appropriate run() method. When the run() method called by a Thread object returns or throws an exception, the thread dies.
Thread; ThreadGroup; Threads 8
This HTML Help has been published using the chm2web software. |