Write a Java program that demonstrates deadlock WITHOUT sync
Write a Java program that demonstrates deadlock WITHOUT synchronized keywoord.
Use explicit locks (or semaphores) to cause a deadlock. Do not use the synchronized keyword. Print messages to indicate when a lock is locked or unlocked to give some indication of what the program is doing. Using Thread.sleep() might be helpful to make a deadlock more likely.
Solution
Below is the code demonstrates deadlock:-
Thank you.
