Hi Ashik,
You've got the concept right
In the above code, <code>readX()</code> is not synchronized. It can be invoked at any time and will return whatever value of 'x' it finds without having to wait to obtain a lock on 'x'.
The <code>writeX(int i)</code> method is <code>synchronized</code>; before a thread can actually execute a write of 'x' it must first obtain the lock. So writes have to wait their turn but reads don't.
Hope that helps.
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform