Top 150+ Solved Object Oriented Programming with C++ (OOP in C++) MCQ Questions Answer

From 91 to 105 of 134

Q. Which of the following statement is correct?

a. A constructor has the same name as the class in which it is present.

b. A constructor has a different name than the class in which it is present.

c. A constructor always returns an integer.

d. A constructor cannot be overloade

  • a. A constructor has the same name as the class in which it is present.

Q. A destructor takes __________ arguments.

a. one

b. two

c. three

d. no

  • d. no

Q. Destructor calls are made in which order of the corresponding constructor calls?

a. Reverse order

b. Forward order

c. Depends on how the object is constructed

d. Depends on how many objects are constructed

  • a. Reverse order

Q. Which of the following never requires any arguments?

a. Member function

b. Friend function

c. Default constructor

d. const function

  • c. Default constructor

Q. A class's __________ is called when an object is destroyed.

a. constructor

b. destructor

c. assignment function

d. copy constructor

  • b. destructor

Q. Which of the following statement is correct whenever an object goes out of scope?

a. The default constructor of the object is called.

b. The parameterized destructor is called.

c. The default destructor of the object is called.

d. None of the above.

  • c. The default destructor of the object is called.

Q. Which allows you to create a derived class that inherits properties from more than one base class?

a. Multilevel inheritance

b. Multiple inheritance

c. Hybrid Inheritance

d. Hierarchical Inheritanc

  • b. Multiple inheritance

Q. Which feature in OOP allows reusing code?

a. Polymorphism

b. Inheritance

c. Encapsulation

d. Data hiding

  • b. Inheritance

Q. The mechanism of deriving a new class from another class

a. Polymorphism

b. Inheritance

c. Encapsulation

d. Data hiding

  • b. Inheritance

Q. A derived class with only one base class

a. Multilevel inheritance

b. Multiple inheritance

c. Single inheritance

d. Hierarchical Inheritance

  • c. Single inheritance

Q. The mechanism of deriving one base class with more than one derived classes

a. Multilevel inheritance

b. Multiple inheritance

c. Hybrid Inheritance

d. Hierarchical Inheritance

  • d. Hierarchical Inheritance

Q. The duplication of inherited members due to the multiple paths can be avoided by making acommon base class is called

a. Abstract class

b. Virtual base class

c. Multiple inheritance

d. Nesting of classes

  • b. Virtual base class

Q. The class that is not used to create object

a. Abstract class

b. Virtual base class

c. Multiple inheritance

d. Nesting of classes

  • a. Abstract class

Q. The mechanism of giving special meaning to an operator

a. Operator overloading

b. Function overloading

c. Constructor overloading

d. Virtual function

  • a. Operator overloading
Subscribe Now

Get All Updates & News