Skip to main content

Posts

Showing posts from November, 2021

Java Thread Interview Questions and answer

What is Thread in Java? Threads are basically the lightweight and smallest unit of processing that can be managed independently by a scheduler.  Threads are referred to as parts of a process that simply let a program execute efficiently with other parts or threads of the process at the same time.  Using threads, one can perform complicated tasks in the easiest way.  It is considered the simplest way to take advantage of multiple CPUs available in a machine. They share the common address space and are independent of each other. What are the benefits of using Multithreading? Allow the program to run continuously even if a part of it is blocked. Improve performance as compared to traditional parallel programs that use multiple processes.  Allows writing effective programs that utilize maximum CPU time Improves the responsiveness of complex applications or programs.  Increase use of CPU re...