Advertisements
Advertisements
प्रश्न
A constructor has the ______ (same/different) name as that of the class.
रिक्त स्थान भरें
Advertisements
उत्तर
A constructor has the same name as that of the class.
Explanation:
In languages like Java, a constructor must perfectly match the spelling and case of the class name. This allows the computer to instantly recognize it as an initialization block rather than a regular method.
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
