Multithreading Interview Questions
Synchronized Method: In this method, the thread acquires a lock on the object when
they enter the synchronized method and releases the lock either normally or by
throwing an exception when they leave the method.
No other thread can use the
whole method unless and until the current thread finishes its execution and release
the lock. It can be used when one wants to lock on the entire functionality of a
Dostları ilə paylaş: