MCQs – C++ Classes and Objects


Q) Data members and member functions of a class in C++ program are by default
  1. protected
  2. public
  3. private
  4. None

Answer: 3


Q) Which operator is used to allocate an object dynamically of a class in C++?
  1. Scope resolution operator
  2. Conditional operator
  3. New operator
  4. Membership access

Answer: 3


Q) Which is used to define the member function of a class externally?
  1. :
  2. ::
  3. #
  4. None

Answer: 2


Q) In C++, an object cannot be created for
  1. An interface
  2. An Abstract class
  3. A singleton class
  4. A & B
  5. A, B & C

Answer: 4


Q) By default functions available in C++ language are
  1. Constructor
  2. Destructor
  3. Copy constructor
  4. Assignment operator
  5. All

Answer: 5


Related Posts