Question: The following class will deadlocked by invoking method t(). Why? class A{ private Semaphore sem; public A(){ sem = new Semaphore (0); } synchronized void

The following class will deadlocked by invoking method t(). Why? class A{ private Semaphore sem; public A(){ sem = new Semaphore (0); \} synchronized void +(){ ... try{ sem.acquire(): \}catch(InterruptedException e)\{\} \} synchronized void +1(){ ... sem.release(); \} \}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
