What is a `deadlock` in Java?
A deadlock occurs when a thread waits for a resource that is already being used by another thread, which causes the first thread to stop executing.
You're close, but deadlock is more specifically about two or more threads waiting for each other to release resources.
Can you explain the typical causes of deadlocks in multithreaded programs and how to detect them?