What is the difference between synchronizing a static method and a non static method in java?Can anybody please explain with an example. Also is there any difference in sync
Dude, just a hint. Not related to your question:
If any do*Stuff() methods does either
this.a= /*yet another*/ new Object();
or
this.b= /*yet another*/ new Object();
then you are screwed. Because the lock is inside the value, not inside the reference. See Java synchronized references