हिंदी

Which constructor initialises data members with default values? - Computer Applications

Advertisements
Advertisements

प्रश्न

Which constructor initialises data members with default values? 

विकल्प

  • Parameterized constructor

  • Non-parameterized constructor

  • Copy constructor

  • Default constructor 

MCQ

उत्तर

Default constructor

Explanation:

A default constructor takes no parameters and sets the data members' default values (for example, 0 for numeric types, null for objects, and false for booleans). If a class does not have a constructor declared, the compiler will provide one by default.

shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 7: Constructors - EXERCISES [पृष्ठ ४१७]

APPEARS IN

अविचल Computer Applications [English] Class 10 ICSE
अध्याय 7 Constructors
EXERCISES | Q I. 4. | पृष्ठ ४१७
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×