Some Important Methods defined in java.lang.Thread are shown in the table:
1. Thread currentThread( ) : Returns an object reference to the thread in which it is invoked.
2. String getName( ) :Retrieve the name of the thread object or instance.
3. void start( ) :Start the thread by calling its run method.
4. void run( ) :This method is the entry point to execute thread, like the main method for applications.
5. void sleep( ):Suspends a thread for a specified amount of time (in milliseconds).
6. boolean isAlive( ) : This method is used to determine the thread is running or not.
7. int activeCount( ) :This method returns the number of active threads in a particular thread group and all its subgroups.
8. void interrupt( ) :The method interrupt the threads on which it is invoked.
9. void yield( ) :By invoking this method the current thread pause its execution temporarily and allow other threads to execute.
10. void join( ) :This method and join(long millisec) Throws InterruptedException. These two methods are invoked on a thread. These are not returned until either the thread has completed or it is timed out respectively.
A thread in Java can be created in 2 ways. Read More:
Program to create multiple threads using Thread class
Program to create multiple threads using Runnable interface