What is the constructor and why use it?

constructors are used for initialize objects . the initialization may be with user given values or default values. The constructor is used to assign values to the variables while creating the object. And the constructors are used to create Object.

Sizin İçin Seçtik  How do you create an instance of an object in Java?

Leave a Reply

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