Thread class methods

1. To know the currently running thread.

       Thread t = Thread.currentThread();

2. To start a thread

    t.start();

3. To stop the execution of a thread for a specified time.

    Thread.sleep(milliseconds);

4. To get name of a thread

    String name = t.getName();

5. To set a new name to a thread.

     t.setName("Name");

6. To get the priority of a thread

   int priorityno = t.getPriority();

7. To set the priority of a thread

    t.setpriority(int priorityno);

8. To test if a thread is still alive

   t.isAlive(); return true/false;

9. To send notification to a waiting thread

    obj.notify();

10. To send notification to all waiting threads

      obj.notifyAll();

11. To wait till the object is released

      obj.wait();