If base class A has a "public synchronized void method(){}" which was not overridden by its derived class B,then what will the lock be (i.e. will it be the derived class object or the base class object) that is used to access the synchronized method in class B?
- This is not a static method, is it?Sergey Kalinichenko– Sergey Kalinichenko2013-11-07 18:34:36 +00:00Commented Nov 7, 2013 at 18:34
- No.Not even block synchronized like synchronized(A.class) or synchronized(getClass()) or synchronized(Class.forName("A"))Sameer Sarmah– Sameer Sarmah2013-11-07 18:42:23 +00:00Commented Nov 7, 2013 at 18:42
Add a comment |