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
In short if you synchronize on a static method you will synchronize on the class (object) and not on an instance (object). That means while execution of a static method the whole class is blocked. So other static synchronized methods are also blocked.