Assume we have 5 array of integer type and we want to add all numbers of array. 1st way ( Sequential Way ) We can pick array one by one and add all numbers and give the result. In this way only one thread (main thread) will execute the program. 2nd way ( Multithreaded Way ) In Multithreaded way, we can create 5 thread and assign an array to each thread to add all the numbers of array. All 5 thread will run parallel and give result 5 times faster than 1st way. What is Thread & Multithreading? A process may contain sub processes which execute parallel and use same resource of main process these sub processes are threads and whole phenomena called Multithreading . How to implement thread in Java? Java thread is sub process of process. In java, Thread class use to achieve multithreading in program. Initialize Thread There is two way to initialize and run thread in java. By extending Thread class By implementing Runnable interface By extending Thre...
