Does a subclass need its own constructor?

A subclass needs a constructor if the superclass does not have a default constructor (or has one that is not accessible to the subclass). If the subclass has no constructor at all, the compiler will automatically create a public constructor that simply calls through to the default constructor of the superclass.18 Mar 2014

Sizin İçin Seçtik  What happens if you do not call super () in the subclass constructor?

Leave a Reply

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