Posts

Showing posts with the label Multithread

Multithreading in java

Image
When more than one task is executing concurrently within a single program is called multithreading in Java . Thread in Java is controlled by java.lang.Thread class. Each program can be divided into number of small process . Each small process is called a single thread . Thread is a lightweight process. Thread can be created using this two way . implementing Runnable interface  extending Thread class    Advantage of Thread :         Threads are independent         Each task of a program can be executed and shared separated memory area.         It's a lightweight process .        Communication coast is low between the Threads .   Life cycle of a thread :                                    Example using Runnable interface : public cla...