title: GC in Java Setter
body: <p>In a Java setter method that assigns a new Object to a field such as:</p>
  
  <pre><code>public class MyClass
  {
       private String s;
       public void mySetter(String newS) {
            s = newS;
       }
  }
  </code></pre>
  
  <p>Does the previous String s get garbage collected after mySetter is called or should I null out s before I assign it to the new value?</p>
  
  <pre><code>public class MyClass
  {
       private String s;
       public void mySetter(String newS) {
            s = null;
            s = newS;
       }
  }
  </code></pre>