title: Synchronizing on an object in java, then changing the value of the synchronized-on variable
body: <p>I came across a code like this </p>
  
  <pre><code>synchronized(obj) {
  
     obj = new Object();
  
  }
  </code></pre>
  
  <p>Something does not feel right about this , I am unable to explain, Is this piece of code OK or there is something really wrong in it, please point it out.
  Thanks</p>