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 ?
For More Questions visit Here -
1) A class cannot be ?
- Virtual
- Generic
- Inline
- Friend
Show Answer
Answer = Inline
2) Objects of the same class share the values of ...... while they maintain separate values for ........ .
- Static variables, non static variables
- Non static variables, static variables
- Global variables, static variables
- Static variables, register variables
Show Answer
Answer = Static variables, non static variables
3) Which of the following keywords cannot appear inside a class definition ?
- friend
- static
- template
- virtual
Show Answer
Answer = template
4) Static Member function
- can access any other member function & member variables
- can access only static member variables & member functions
- can be only called through object of the class
- Returns only static data
Show Answer
Answer = can access only static member variables & member functions
5) A friend function
- is declared as a friend & defined elsewhere in the program
- is always an inline function
- created objects without initialization
- 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 ?
- The base class member can be accessed by derived class objects
- The base class members cannot be accessed by the derived class members
- The derived class members can be accessed by the base class objects
- None of above
Show Answer
Answer = The base class member can be accessed by derived class objects
7) Choose most appropriate statement
- An abstract base class can have pure virtual destructor
- An abstract base class can have only virtual destructor
- An abstract base class can have non virtual destructor
- 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 .......
- Writing constructor
- Is not possible
- overloaded casting operator
- object of a class
Show Answer
Answer = Writing constructor
9) When a base class pointer points to derived class object?
- It can access only base class members
- It can access only derived class members
- Both base class & derived class members
- None
Show Answer
Answer = It can access only base class members
10) Shallow copy is
- Member wise copying of objects
- A substitute for the operator
- Same kind like deep copy
- 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.