In simple words a static synchronized
method will lock the class instead of the object, and it will lock the class because the keyword static
means: "class instead of instance".
The keyword synchronized
means that only one thread can access the method at a time.
And static synchronized
mean:
Only one thread can access the class at one time.