CPP Programming MCQs | Page - 3
Dear candidates you will find MCQ questions of CPP Programming here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
β
Correct Answer: (A)
Composition is a strong type of association between two classes with full ownership.
Q. Which of the following is not a correct statement?
β
Correct Answer: (B)
Abstract class can directly be initiated with ‘new’ operator.
Q. When a method in a subclass has the same name and type signatures as a method in the superclass, then the method in the subclass _____ the method in the superclass.
β
Correct Answer: (D)
Overrides
Q. It is possible to define a class within a class termed as nested class. There are _____ types of nested classes.
β
Correct Answer: (A)
2
Q. When one object reference variable is assigned to another object reference variable then
β
Correct Answer: (B)
a copy of the reference is created.
Q. Which of the following is not a member of class?
β
Correct Answer: (B)
Friend function
Q. How can we restrict dynamic allocation of objects of a class using new?
β
Correct Answer: (C)
By making an empty private new and new[] operators
Q. Which of the following operators cannot be overloaded?
β
Correct Answer: (D)
All of the above
Q. Which of the following operators are overloaded by default by the compiler in every user defined classes even if user has not written? 1) Comparison Operator (==) 2) Assignment Operator (=)
β
Correct Answer: (C)
Only 2
Q. Which of the following operators should be preferred to overload as a global function rather than a member method?
β
Correct Answer: (C)
Insertion Operator <<
Jump to