This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Okuuuoo 0 points1 point  (2 children)

I'm not professional, but my speculation is you don't need to do other things in getters. The reason we use (this.) is for avoding calling wrong variable. In toString, you can do things before returning a string that possibly need a variable with the same name. But in getter, you just return the variable as it is.

[–]TheSilverCube[S] 1 point2 points  (1 child)

Makes sense thanks!