What do we use constructors for?

A constructor is used to initialize the state of an object . A method is used to expose the behavior of an object. A constructor must not have a return type. A method must have a return type.

Sizin İçin Seçtik  How do you introduce a method in Java?

Leave a Reply

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