What’s a default constructor? How are an object’s data members ini- tialized if a class has only a default constructor defined by the compiler?
What will be an ideal response?
A default constructor is the constructor that is called when you create an object with- out specifying any arguments to a constructor. You can write a default constructor
that initializes data members any way you choose. The compiler provides a default constructor with no parameters in any class that does not explicitly include a con structor. The default constructor provided by the compiler creates an object without assigning any initial values to the object’s fundamental type data members—data members must be initialized using the object’s member functions. Every constructor implicitly calls the constructors of any data member objects before the body of the class’s constructor executes.
You might also like to view...
Double clicking on a query from the Navigation Pane will ________ the query so a user can view the results
Fill in the blank(s) with correct word
Choose the correctly capitalized sentence.?
A. ?Cayla will fly to San Diego to meet her aunt Tess. B. ?Cayla will fly to San Diego to meet her Aunt Tess.