> 
> **Possible Duplicate:**  
> 
> [When should I use “this” in a class?](https://stackoverflow.com/questions/2411270/when-should-i-use-this-in-a-class) 
> 
> 
> 

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

for example:

```
return this.name

```

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

```
public void setName(String name) {
    this.name = name;
}

```

Other than that, "this" seems unneeded.. What are some other cases?