How super () is used with constructor?

super() is used to call Base class’s constructor(i.e, Parent’s class) while this() is used to call current class’s constructor. super() is use to call Base class’s(Parent class’s) constructor. Flow of Program : In main, we have made a statement new Child(), so it calls the no argument constructor of Child class.

Sizin İçin Seçtik  Seçmeli ders vermeden mezun olunur mu?

Leave a Reply

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

How super () is used with constructor?

super() is used to call Base class’s constructor(i.e, Parent’s class) while this() is used to call current class’s constructor. super() is use to call Base class’s(Parent class’s) constructor. Flow of Program : In main, we have made a statement new Child(), so it calls the no argument constructor of Child class.

Sizin İçin Seçtik  Why do we need required in Flutter?

Leave a Reply

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