What is a method with a class name known as?
Advertisements
प्रश्न
What is a method with a class name known as?
लघु उत्तर
Advertisements
उत्तर
A method having the same name as its class is known as a Constructor in Java. A constructor is a special member of a class that is automatically called when an object is created. It is used to initialize the data members of an object and does not have a return type.
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 4: Objects - EXERCISE [पृष्ठ १०७]
