Do abstract classes need to have constructors?

The main purpose of the constructor is to initialize the newly created object. In abstract class, we have an instance variable, abstract methods, and non-abstract methods. We need to initialize the non-abstract methods and instance variables, therefore abstract classes have a constructor .

Sizin İçin Seçtik  Yapıcı Method constructor Nedir neden kullanıyoruz?

Leave a Reply

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

Do abstract classes need to have constructors?

The main purpose of the constructor is to initialize the newly created object. In abstract class, we have an instance variable, abstract methods, and non-abstract methods. We need to initialize the non-abstract methods and instance variables, therefore abstract classes have a constructor .

Sizin İçin Seçtik  What is constructor used for?

Leave a Reply

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