These (Thread a,b & c) are three different threads. When you start them they will run in any order (which JVM will decide). Making run method synchronize won't help. When you start those threads they will run their own run methods (which are from three different ThreadBob objects) , each of those have no relation with other's.
chetan dhumane wrote:Thanks
Then how that synch block will help me.
Modifying the code as I suggested will make use of the synchronized and will run sequentially. Otherwise it is not guaranteed to run in a sequence. Please note that if you are synchronizing, in other words acquiring lock, make sure it is on the single object. Otherwise it really does not make sense.