In my Java class I have made some attributes and methods. Within one of the methods I have called upon an attribute of the class, however, the method works both with and without using "this." in front of the attribute. If this is not necessary, I am wondering what is even the purpose of "this."
public String getName() {
return name;
}
^^ Works ^^
public String getName() {
return this.name;
}
^^ Works ^^