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.

M

Mr. Dubey • 52.52K Points
Coach

Q. Which of the following is a correct statement?

(A) Composition is a strong type of association between two classes with full ownership.
(B) Composition is a strong type of association between two classes with partial ownership.
(C) Composition is a weak type of association between two classes with partial ownership.
(D) Composition is a weak type of association between two classes with strong ownership.
View Answer Discuss Share

M

Mr. Dubey • 52.52K Points
Coach

Q. Which of the following is not a correct statement?

(A) Every class containing abstract method must be declared abstract.
(B) Abstract class can directly be initiated with ‘new’ operator.
(C) Abstract class can be initiated.
(D) Abstract class does not contain any definition of implementation.
View Answer Discuss Share

M

Mr. Dubey • 52.52K Points
Coach

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.

(A) Overloads
(B) Friendships
(C) Inherits
(D) Overrides
View Answer Discuss Share

M

Mr. Dubey • 52.52K Points
Coach

Q. It is possible to define a class within a class termed as nested class. There are _____ types of nested classes.

(A) 2
(B) 3
(C) 4
(D) 5
View Answer Discuss Share

M

Mr. Dubey • 52.52K Points
Coach

Q. When one object reference variable is assigned to another object reference variable then

(A) a copy of the object is created.
(B) a copy of the reference is created.
(C) a copy of the reference is not created.
(D) it is illegal to assign one object reference variable to another object reference variable.
View Answer Discuss Share

M

Mr. Dubey • 52.52K Points
Coach

Q. Which of the following is not a member of class?

(A) Static function
(B) Friend function
(C) Const function
(D) Virtual function
View Answer Discuss Share

M

Mr. Dubey • 52.52K Points
Coach

Q. How can we restrict dynamic allocation of objects of a class using new?

(A) By overloading new operator
(B) By making an empty private new operator.
(C) By making an empty private new and new[] operators
(D) By overloading new operator and new[] operators
View Answer Discuss Share

M

Mr. Dubey • 52.52K Points
Coach

Q. Which of the following operators cannot be overloaded?

(A) . (Member Access or Dot operator)
(B) ?: (Ternary or Conditional Operator)
(C) :: (Scope Resolution Operator)
(D) All of the above
View Answer Discuss Share

M

Mr. Dubey • 52.52K Points
Coach

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 (=)

(A) Both 1 and 2
(B) Only 1
(C) Only 2
(D) None of the two
View Answer Discuss Share

M

Mr. Dubey • 52.52K Points
Coach

Q. Which of the following operators should be preferred to overload as a global function rather than a member method?

(A) Postfix ++
(B) Comparison Operator
(C) Insertion Operator <<
(D) Prefix++
View Answer Discuss Share

Jump to

Download our easy to use, user friendly Android App from Play Store. And learn MCQs with one click.

Image