I'm currently preparing for OCJMD..
I've a doubt like
suppose, In the above code, I need to protect the variable 'a' from being accessed by other threads while execution.
I do not understand 'how invoking of lock() method on a 'ReentrantLock' object, will make the current thread to get a lock on the variable 'a'??