Conclusion
Well done! You just learned how to use class inheritance, and the coding style of polymorphism. You should be proud of yourself!
This is an advanced lesson following the basics you learned in previous lessons. So, in the next few lessons, you’ll learn more specifically about inheritance, polymorphism and more. Finally, here are the key takeaway points from this lesson:
- Through inheritance, a class automatically gets the properties and methods declared in the main class.
- The hierarchies only go one way in inheritance.
- The
openkeyword means that a main class isopento be inherited from. - A class that inherits from another class is known as a subclass or a derived class.
- Polymorphism is a programming language’s ability to treat an object differently based on the context.