Why do we call super in constructor?

We use super keyword to call the members of the Superclass . As a subclass inherits all the members (fields, methods, nested classes) from its parent and since Constructors are NOT members (They don’t belong to objects. They are responsible for creating objects), they are NOT inherited by subclasses.8 May 2012

Sizin İçin Seçtik  Does Java call super constructor automatically?

Leave a Reply

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

Why do we call super in constructor?

We use super keyword to call the members of the Superclass . As a subclass inherits all the members (fields, methods, nested classes) from its parent and since Constructors are NOT members (They don’t belong to objects. They are responsible for creating objects), they are NOT inherited by subclasses.8 May 2012

Sizin İçin Seçtik  What is constructor chaining shows with example?

Leave a Reply

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