What is a constructor used for?

Constructor is used to initializing objects of a class and allocate appropriate memory to objects . That is, it is used to initialize the instance variables of a class with a different set of values but it is not necessary to initialize.

Sizin İçin Seçtik  What is __ class __ in Python?

Leave a Reply

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