Deutsche Bank Interview Question

wait ,notify detail explanation

Interview Answer

Anonymous

Oct 19, 2020

wait notify & notifyall are all object class methods, wait releases the lock occupied by current thread of execution, while notify is just a signal to jvm that any one thread waiting for current lock can be invoked only once the code gets executed & lock is available , additionally wait & notify they must be used inside synchronized block