I want to know the difference between static synchronized and non static synchronized. Please anybody explain simple and briefly. I am still confusing. If you have the example code for static synchronized method that give to me.
for non static synchronised method:
each object has its own lock and non-static synchronised code cannot be entered by a thread if another thread already has taken that particular object's lock.
basically Non-static synchronized methods synchronize on the instance (this) of the class.
for static synchronised metods:
Static methods use the class as the object for locking