Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
David Douglas3,719 Points
Getters for set properties
In previous videos we used a getter method to retrieve a backing property declared in a setter. In this answer section the area and circumference properties are called through dot notation. Can you explain why?
Steven Parker224,849 Points
Getter methods and ordinary properties are both accessed through dot notation. Calling a getter looks exactly like a reference to a property in the code.
But the reason area and circumference don't need getter methods is that they are set by the radius setter method and don't have setters of their own. Since there are no setters using the same name, they can be ordinary properties.