<<< Sample output for the IOThread example     Index     Example: IOTask class implementing the Runnable interface >>>

15. Creating a thread implementing Runnable interface


  1. Create a class that implements the Runnable interface.

  2. Implement the run() method to perform the desired task.

  3. Create the thread by supplying an instance of the Runnable class to the Thread constructor.

  4. Call the start() method of the thread object.

     


<<< Sample output for the IOThread example     Index     Example: IOTask class implementing the Runnable interface >>>