public class Cat{
private String name;
public void setName(String name){
this.name=name;//set name by passing current reference of object .
}
public String  getName()
return name;//return name or return this.name
//which will correct ?
}
Both will work but I don't understand In return name; how reference passed . Can any one will give brief information?