My question is if I have some code like the following -:
public class OuterClass{
public class InnerClass{
public synchronized methodA(){ /* doe
Since you have made the inner class method as synchronized it won't lock the outer class object rather it will only lock the inner class method. To synchronize the outer class as stated earlier it can done as shown below
public void methA()
{
synchronized(OuterClass.this)
{`enter code here`
// ...
}
}