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...
The first time a client connects to a server for a web app that uses sessions, the server creates a unique ________ that can later be compared to others in the server’s memory in order to identify the client.
a) session ID b) HttpSessionState object c) cookie d) None of the above.
Explain the difference between an implicit type cast and an explicit type cast.
What will be an ideal response?
Which of the following would NOT be an advantage of telecommuting?
A) It can reduce traffic congestion and reduce dependence upon foreign oil. B) Friends and family can cause distractions. C) It can reduce company overhead for parking and office space. D) It provides flexibility for parents and caregivers to deal with the needs of family members.
Array elements are passed to a called function in the same manner as __________________ variables.
Fill in the blank(s) with the appropriate word(s).