title: Garbage Collection's working
body: <p>Here I have a Java doubt regarding the Garbage Collection:</p>
  
  <pre><code>protected class Robocop {
  Integer weight = 200;
  
  Robocop attent(Robocop rb) {
  rb = null;
  return rb;
  }
  public static void main(String[] args) {
  System.out.println("indeed the solution is behind the corner);
  
  Robocop rb1 = new Robocop();
  
  Robocop rb2 = new Robocop();
  
  Robocop rb3 = rb1.attent(rb2);
  
  rb1 = null;
  
  }
  }
  </code></pre>
  
  <p>How many objects do you reckon are going to be eligible for GC?</p>
  
  <p>My take on this, would be 4 object to be garbage collected rb3, rb1 and the related Integer wrapper instance variables.</p>