Advertisements
Advertisements
प्रश्न
What is meant by a constructor?
लघु उत्तरीय
उत्तर
A constructor is a member method with the same name as the class. It initializes data members or instance variables and creates class objects.
Example: Car ob = new Car();
The statement invokes the Car class's default constructor.
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?