हिंदी

A constructor has the ______ (same/different) name as that of the class.

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
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 4: Constructors - Exercises [पृष्ठ ११५]

APPEARS IN

रुपा पंडित Computer Applications [English] Class 10 ICSE
अध्याय 4 Constructors
Exercises | Q 2. (i) | पृष्ठ ११५
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×