How can a thread avoid deadlock when acquiring multiple locks?
By acquiring all locks in the same order consistently
By always using synchronized blocks instead of ReentrantLock
By introducing random delays between lock acquisition
By acquiring a lock only if it is not already held by another thread
This question is part of this quiz :
Java Concurrency Locks and Reentrant Locks