ObjectiveMcq
Print Protected
This page is protected for print. Use the website to view the content.
Which of the following statements about a constructor is not true?
Correct Answer: C — An object with a constructor can be used as a member of a union.
An object with a constructor cannot be used as a member of a union. A union is a limited form of the class type. It can contain access specifiers (public, protected, private), member data, and member functions, including constructors and destructors. It cannot contain virtual member functions or static data members. Default access of members in a union is public. A union cannot be used as a base class and cannot be derived from a base class. (same with the constructor too, constructor cannot be inherited, though a derived class can call the basic class constructor).