Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS Object-Oriented Swift Inheritance Inheritance Terminology Review

Gustavs Gutmanis
Gustavs Gutmanis
2,022 Points

The last question asks if the subclass inherits all props & methods of its superclass. It doesn't inherit private ones.

While this might fly with complete beginners, I just wanted to mention that subclasses may not inherit all of the methods and properties of its superclass. Since some of them might be private. I realize that it might be counter-productive to let beginners answer "false" on that one, but I felt a little betrayed that I got a wrong answer there :)

2 Answers

Chris Shaw
Chris Shaw
26,662 Points

Hi Gustavs,

The question doesn't mentioned inheritance, it mentions does the subclass have access to methods and properties of it's super class which it does, the question doesn't place any context around public and private types.

Hope that helps.

Gustavs Gutmanis
Gustavs Gutmanis
2,022 Points

Thank you for the clarification

Gustavs Gutmanis
Gustavs Gutmanis
2,022 Points

Looks like I am unable to form a simple question in the title...