Object Oriented Programming Using C++ Solved MCQs

1.

Which of the two features match each other?

A. Inheritance and Encapsulation
B. Encapsulation and Polymorphism
C. Encapsulation and Abstraction
D. Abstraction and Polymorphism
Answer» C. Encapsulation and Abstraction
2.

What is default access specifier for data members or member functions declared within a class without any specifier, in C++?

A. Private
B. Protected
C. Public
D. Depends on Compiler
Answer» A. Private
3.

If a function can perform more than 1 type of tasks, where the function name remains same, which feature of OOP is used here?

A. Encapsulation
B. Inheritance
C. Polymorphism
D. Abstraction
Answer» C. Polymorphism
4.

Which feature in OOP is used to allocate additional function to a predefined operator in any language?

A. Operator Overloading
B. Function Overloading
C. Operator Overriding
D. Function Overriding
Answer» A. Operator Overloading
5.

Which among the following best defines abstraction?

A. Hiding the implementation
B. Showing the important data
C. Hiding the important data
D. Hiding the implementation and
Answer» D. Hiding the implementation and
6.

A base class is also known as class.

A. Basic
B. Inherited
C. Super
D. Sub
Answer» C. Super
7.

If class A is derived from another derived class B which is derived from class C, which class will have maximum level of abstraction?

A. Class A
B. Class B
C. Class C
D. All have the same level of abstraction
Answer» C. Class C
8.

Derived class is also known as                              

A. Sub Class
B. Small Class
C. Big Class
D. Noticeable Class
Answer» A. Sub Class
9.

Which of the following gets called when an object is being created?

A. Constructor
B. Virtual Function
C. Destructors
D. Main
Answer» A. Constructor
10.

Destructor has a same name as the constructor and it is preceded by?

A. !
B. ?
C. ~
D. $
Answer» C. ~
11.

Which of the following is called address operator?

A. *
B. &
C. _
D. %
Answer» B. &
12.

Which of the following is used for comments in

A. //comment
B. /comment
C. *comment
D. ?comment
Answer» A. //comment
13.

What is used to read from the console in C++?

A. cin
B. scanf
C. read
D. getline
Answer» A. cin
14.

What is used to write/display to the console in C++?

A. printf
B. cout
C. write
D. putline
Answer» B. cout
15.

Which operator is used with cin ?

A. >>
B. <<
C. >
D. <
Answer» A. >>
16.

Which operator is used with cout?

A. >>
B. <<
C. >
D. <
Answer» B. <<
17.

Which feature of OOP indicates code reusability?

A. Encapsulation
B. Inheritance
C. Abstraction
D. Polymorphism
Answer» B. Inheritance
18.

Which feature can be implemented using

A. Inheritance
B. Abstraction
C. Polymorphism
D. Overloading
Answer» B. Abstraction
19.

Which of the following is not a type of Constructor?

A. Friend constructor
B. Copy constructor
C. Default
D. Parameterized
Answer» A. Friend constructor
20.

What is the other name used for functions inside a

A. Member variables
B. Member functions
C. Class functions
D. Class variables
Answer» B. Member functions
21.

Which among the following can restrict class members to get inherited?

A. Private
B. Protected
C. Public
D. All three
Answer» A. Private
22.

Which type of members can’t be accessed in derived classes of a base class?

A. Protected
B. Private
C. Public
D. All can be accessed
Answer» B. Private
23.

Which of the following is true?

A. All objects of a class share all data members of class
B. Objects of a class do not share non-static members. Every object has its own copy
C. Objects of a class do not share codes of non-static
D. None of these
Answer» B. Objects of a class do not share non-static members. Every object has its own copy
24.

Which among the following is not true for polymorphism?

A. It is feature of OOP
B. Ease in readability of program
C. Helps in redefining the
D. Increases overhead of function
Answer» D. Increases overhead of function
25.

If different properties and functions of a real world entity is grouped or embedded into a single element, what is it called in OOP language?

A. Inheritance
B. Polymorphism
C. Abstraction
D. Encapsulation
Answer» D. Encapsulation
26.

If same message is passed to objects of several different classes and all of those can respond in a different way, what is this feature called?

A. Inheritance
B. Overloading
C. Polymorphism
D. Overriding
Answer» C. Polymorphism
27.

Out of the following, which is not a member of the

A. Static function
B. Friend function
C. Const function
D. Virtual function
Answer» B. Friend function
28.

Which of the following is an abstract data type?

A. int
B. float
C. class
D. string
Answer» C. class
29.

Which of the following is not a type of inheritance?

A. Multiple
B. Multilevel
C. Distributive
D. Hierarchical
Answer» C. Distributive
30.

Which of the following is correct in C++?

A. Classes cannot have protected data members
B. Structures can have member functions
C. Class members are public by default
D. Structure members are private by default
Answer» B. Structures can have member functions
Tags
Question and answers in Object Oriented Programming Using C++, Object Oriented Programming Using C++ multiple choice questions and answers, Object Oriented Programming Using C++ Important MCQs, Solved MCQs for Object Oriented Programming Using C++, Object Oriented Programming Using C++ MCQs with answers PDF download