My question is if I have some code like the following -:
public class OuterClass{ public class InnerClass{ public synchronized methodA(){ /* doe
It will use the this of the immediately enclosing class so the inner class. You can use instead:
this
public void m() { synchronized(OuterClass.this) { } }