What if we dont use constructor?

you wouldn’t be able to create objects/instances of classes , basically: you would only be able to use primitive datatypes. Even you don’t write any constructor, a default constructor exists there. So you can still create objects without passing any parameters.

Sizin İçin Seçtik  Is a constructor mandatory for a class?

Leave a Reply

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