Welcome to the Treehouse Community
Looking to learn something new?
Simon Andersson6,880 Points
Confused on "this"
Hi. When the constructor is created, you say "this refers to the CURRENT object". What do you mean by the current object?
Steven Parker216,108 Points
The current object is the one being created when the constructor runs.
The constructor code only runs when an instance of the class is being created. Inside the constructor, "this" represents that new instance.
Alexandre C.1,245 Points
I am a little bit confused about encapsulation. I understand that if I use the class, I can't modify the array, because it uses the public MapLocation/path, which also uses the private MapLocation/_path
What I don't understand is what prevents me to use the MapLocation in Main. Could'nt I acces this Main/MapLocation and change the values of the array?
I hope you understand me, I'm pretty newbie into the coding-world.