Does a subclass constructor need to use super?

It is required if the parameterized constructor (a constructor that takes arguments) of the superclass has to be called from the subclass constructor . The parameterized super() must always be the first statement in the body of the constructor of the subclass, otherwise, we get a compilation error.

Sizin İçin Seçtik  Can constructor be inherited through a subclass that calls the superclass constructor?

Leave a Reply

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