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
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?