What is constructor write the types of constructor with example?

Difference between constructor and method in Java Java ConstructorJava MethodA 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.Java Constructor – Javatpoint www.javatpoint.com › java-constructor

Sizin İçin Seçtik  What is constructor type C++?

Leave a Reply

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