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.

PHP Object-Oriented PHP Basics (Retired) Properties and Methods Properties

Child classes are just out of luck?

What does he mean by, "child classes are just out of luck"?

2 Answers

Randy Perez
Randy Perez
5,668 Points

As he mentioned in that video don't get worried about inheritance just yet and child classes is a term of that subject.

But to let you know when a class inherits(child) from an other class(parent) it becomes a child class of the original parent class. The protected and public method and variables are available for that child class but the private ones are not. That's what he is trying to state

Hope this helps.

I still don't understand the sentence, "the child classes are just out of luck" but what you wrote does make sense. I just don't understand what is created out of luck? The child classes are created unintentionally whenever you create a parent? I just don't understand what he is saying, but i guess it really doesn't matter.