C++ Classes and Objects Questions and Answers, MCQ of C++ Programming

C++ Classes and Objects Multiple Choice Questions and Answers, MCQ of C++ Programming. Following questions depends on the c++ classes and objects. Each questions has its unique answer.
1) A class cannot be ?
  1. Virtual
  2. Generic
  3. Inline
  4. Friend
Show Answer
Answer = Inline
2) Objects of the same class share the values of ...... while they maintain separate values for ........ .
  1. Static variables, non static variables
  2. Non static variables, static variables
  3. Global variables, static variables
  4. Static variables, register variables
Show Answer
Answer = Static variables, non static variables
3) Which of the following keywords cannot appear inside a class definition ?
  1. friend
  2. static
  3. template
  4. virtual
Show Answer
Answer = template
4) Static Member function
  1. can access any other member function & member variables
  2. can access only static member variables & member functions
  3. can be only called through object of the class
  4. Returns only static data
Show Answer
Answer = can access only static member variables & member functions
5) A friend function
  1. is declared as a friend & defined elsewhere in the program
  2. is always an inline function
  3. created objects without initialization
  4. May be a static member function of the class
Show Answer
Answer = is declared as a friend & defined elsewhere in the program
6) If a base class member access is public, and an inherited class accesses specifier is private, which of the following statement is true ?
  1. The base class member can be accessed by derived class objects
  2. The base class members cannot be accessed by the derived class members
  3. The derived class members can be accessed by the base class objects
  4. None of above
Show Answer
Answer = The base class member can be accessed by derived class objects
7) Choose most appropriate statement
  1. An abstract base class can have pure virtual destructor
  2. An abstract base class can have only virtual destructor
  3. An abstract base class can have non virtual destructor
  4. An abstract base class cannot have destructor
Show Answer
Answer = An abstract base class cannot have destructor
8) The conversion from basic data to class type can be done by .......
  1. Writing constructor
  2. Is not possible
  3. overloaded casting operator
  4. object of a class
Show Answer
Answer = Writing constructor
9) When a base class pointer points to derived class object?
  1. It can access only base class members
  2. It can access only derived class members
  3. Both base class & derived class members
  4. None
Show Answer
Answer = It can access only base class members
10) Shallow copy is
  1. Member wise copying of objects
  2. A substitute for the operator
  3. Same kind like deep copy
  4. Used in constructor
Show Answer
Answer = Member wise copying of objects

For More Questions visit Here -


Do You Like This? Please take 5 seconds to share with your firends.