Multi Threading Java Interview Questions – Set 05

What method is invoked to cause an object to begin executing as a separate thread? The start() method of the Thread class is invoked to cause an object to begin executing as a separate thread. Why do threads block on I/O? Threads block on I/O (that is enters the waiting state) so that other threads may execute while the … Read more

Multi Threading Java Interview Questions – Set 04

What invokes a thread’s run() method After a thread is started, via its start() method or that of the Thread class, the JVM invokes the thread’srun() method when the thread is initially executed. When a thread is created and started, what is its initial state A thread is in the ready state after it has been created and started. How … Read more

Multi Threading Java Interview Questions – Set 03

What is garbage collection The runtime system keeps track of the memory that is allocated and is able to determine whether that memory is still useable. This work is usually done in background by a low-priority thread that is referred to as garbage collector. When the gc finds memory that is no longer accessible from … Read more

Multi Threading Java Interview Questions – Set 02

What is synchronization and why is it important? With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchronization, it is possible for one thread to modify a shared object while another thread is in the process of using or updating that object’s value. This often … Read more

Multi Threading Java Interview Questions – Set 01

What is the wait/notify mechanism? This deals with concurrent programming. The wait() and notify() methods are designed to provide a mechanism to allow a thread to be block until a specific condition is met. However, java.util.concurrent should be used instead of wait() and notify() to reduce complexity. How can a collection object be sorted? // … Read more