title: Locking and synchronization between outer and inner class methods?
body: <p>My question is if I have some code like the following -:</p>
  
  <pre><code>public class OuterClass{
     public class InnerClass{
            public synchronized methodA(){ /* does something */}
     }
  }
  </code></pre>
  
  <p>now when multiple threads want to call the inner class method will they acquire a lock for the outer class object or for the inner class object and how does one modify the statement so that I synchronize access to the outer class object/</p>