I have been trying to learn about classes and objects for the last few days and I realized that using "this.set" and "set" inside a constructor made no apparent difference. To clarify
public Movie(String title,String director, String rating) {
setTitle(title);
setDirector(director);
setRating(rating);
and
public Movie(String title,String director, String rating) {
this.setTitle(title);
this.setDirector(director);
this.setRating(rating);
made no difference while running.
What is the difference, if there is any and which one is better practice?
I was expecting there to be some kind of error, but it worked completely the same. In addition, my instructor does not use "this." while putting a setter inside a constructor in his examples.
Thanks.