Default constructor initializes all data members as ___________

default-constructor-initializes-all-data-members-as

Default constructor initializes all data members as ___________

A. All numeric member with some garbage values and string to random string

B. All numeric member with some garbage values and string to null

C. All numeric member with zero and strings to random value

D. All numeric member with zero and strings to null

I got this question during an interview.

This intriguing question comes from Types of Constructors in portion Constructors and Destructors of Object Oriented Programming

Right choice is D. All numeric member with zero and strings to null

To explain: Default constructor, which even the programmer doesn’t define, always initialize the values as zero if numeric and null if string. This is done so as to avoid the accidental values to change the conditional statements being used and similar conditions.