Oct 08

Create a new Instance of Thread and call its start() method to start it.
You give the Thread constructor some instance that implements the Runnable interface. Once started the Thread will call the Runnable instances run() method is a separate thread.


Thread thread = new Thread(new Runnable()
{
   public void run()
   {
       // this will be run in a separate thread

       doSomething();
   }
});

// start the thread

thread.start();

written by objects \\ tags:


Leave a Reply