Can someone please explain this:
"A
thread can acquire more than one lock. For example, a thread can enter a synchronized method, thus acquiring a lock, and then immediately invoke a synchronized method on a different object, thus acquiring that lock as well. Also, if a thread acquires a lock and then attempts to call a synchronized method on the same object, no problem."
Can you please give an example this to explain the above statements.
Thanks!