The general form of synchronized block is
Here obj means object of table class or object of any class.class table { ....... void printTable(int n) { synchronized(obj) { ...... } } }
If we write this in place of obj ,then an object of table class can’t access the synchronized block from two different threads.
MYDOUBTS:
1)Is it possible to write name of object other than table class in place of obj?
2)If write other object’s name other than table class in place of obj,what it means?
3)Then which object can’t access the synchronized block simultaneously?