मराठी

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×