What is a `deadlock` in Java?
A deadlock occurs when two or more threads are blocked forever, each waiting for the other to release a lock. It happens when threads try to acquire locks in different orders.
Excellent! You've got the correct definition of a deadlock.
Can you explain how you would avoid deadlocks in Java applications when using multiple synchronized blocks?