Advertisements
Advertisements
प्रश्न
when is a constructor invoked?
लघु उत्तरीय
टिप्पणी लिखिए
उत्तर
- A constructor is invoked as soon as the object is created to initialize the object.
- E.g., Car hybrid = new Car();
- In the above example, Car() is invoking a default constructor.
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?