Kotlin Tutorial – 25 – Inheritance with Primary & Secondary Constructor



In this episode we learn about what are the relationships between kotlin inheritance and constructors.

If there is primary constructors present both in parent and child class, then you have to initialize the base class primary constructor from the derived class primary constructor.

If there is only secondary constructor present in the child class, then you have to initialize the parent primary constructor by using super keyword from the child secondary constructor.

Like my Facebook page…

, , , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *