up previous next contents
Next: Thread methods Up: Threads Previous: Creating a threaded class   Contents

Creating a threaded class with the runnable interface

  • Cannot always extend the Thread class because of single inheritance.
  • Implement the java.lang.Runnable interface (must implement the run() method).
  • Include a Thread attribute in the class.
  • The run() method still defines the behavior of the thread while it is running.


up previous next contents
Next: Thread methods Up: Threads Previous: Creating a threaded class   Contents