When is it appropriate to use "this" in Java 
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2411270/when-should-i-use-this-in-a-class">When should I use &ldquo;this&rdquo; in a class?</a>  </p>
</blockquote>



<p>How does one know whether to use "this" when referring to a field of an instance?</p>

<p>for example:</p>

<pre><code>return this.name
</code></pre>

<p>i was taught one case where it is useful. i.e. when an input parameter is the same as the field's name:</p>

<pre><code>public void setName(String name) {
    this.name = name;
}
</code></pre>

<p>Other than that, "this" seems unneeded.. What are some other cases?</p>
