Why constructor is called?

Note: It is called constructor because it constructs the values at the time of object creation . It is not necessary to write a constructor for a class. It is because java compiler creates a default constructor if your class doesn’t have any.

Sizin İçin Seçtik  How do you declare a class attribute in Java?

Leave a Reply

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