Can someone explain me what is the difference between those two codes? When I have to use first and when second? It is clear that when method has parameter with the same name as data member in the class, I have to use "this". But here method dont have any parameters. When in this case I have to use "this"?
public float getPrice(){
return this.price;
}
public float getPrice(){
return price;
}