How are constructors used in inheritance in Java?

In java, the default constructor of a parent class called automatically by the constructor of its child class . That means when we create an object of the child class, the parent class constructor executed, followed by the child class constructor executed.

Sizin İçin Seçtik  Can a superclass call a subclass constructor?

Leave a Reply

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