How to Use Threads
One can implement threads in two ways:
- First, by subclassing the Thread class
- Second, by implementing the Runnable interface
A class that implements the Runnable interface (including the Thread class itself) must implement the run() method containing the "body" of the thread.
The Runnable interface makes it possible for an applet to utilize threads. (Remember, an applet extends the Applet class and so cannot multiply inherit from the Thread class.)