title: Object isn't replaced by new object
body: <p>I have an Object <em>gameControl</em>, which I'd like to recall when a Method reset is called and just re-create the Object, because there are a lot of references created in the <em>gameControl</em> Object to other classes.</p>
  
  <p>What I've already tried to do is as following:</p>
  
  <pre><code>public void reset() {
    gameControl = null;
    gameControl = new GameControl();
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>public void reset() {
    gameControl = new GameControl();
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>public void reset() {
    gameControl = null;
    System.gc();
    gameControl = new GameControl();
  }
  </code></pre>
  
  <p>reset is a function in Commands, Commands is called in Main and the object of GameControl is being created in Main().</p>
  
  <p>Note that reset gets the GameControl object by reference.</p>
  
  <p><strong>Reset function is in an enumerator, so Syntax might be a little weird</strong></p>
  
  <pre><code>RESET("reset") {
      public void execute(MatchResult matcher, GameControl gameControl)
              throws ArgException{
          gameControl = null;
          gameControl = new GameControl();
      }
  </code></pre>
  
  <p>Expected result is when the new Object is created:</p>
  
  <p>Object and Object reference values should be cleared.</p>
  
  <p>Actual result:</p>
  
  <p>Not sure if its the same object, but the reference values are still saved, so I think it is. For instance Two-Dimensional array is being created in gameControl and after the recreation, the object still exists with modified values.</p>
  
  <p>Thanks in advance!</p>