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

From 76 to 90 of 134

Q. Which of the following function / types of function cannot have default parameters?

a. Member function of class

b. main()

c. Member function of structure

d. Both B and C

  • b. main()

Q. For automatic objects, constructors and destructors are called each time the objects

a. enter and leave scope

b. inherit parent class

c. are constructed

d. are destroyed

  • a. enter and leave scope

Q. Which constructor function is designed to copy objects of the same class type?

a. Create constructor

b. Object constructor

c. Dynamic constructor

d. Copy constructor

  • d. Copy constructor

Q. Which of the following statement is correct?

a. Constructor has the same name as that of the class.

b. Destructor has the same name as that of the class with a tilde symbol at the beginning.

c. Both A and B.

d. Destructor has the same name as the first member function of the class.

  • c. Both A and B.

Q. When are the Global objects destroyed?

a. When the control comes out of the block in which they are being used.

b. When the program terminates.

c. When the control comes out of the function in which they are being used.

d. As soon as local objects die.

  • b. When the program terminates.

Q. Which of the following gets called when an object goes out of scope?

a. constructor

b. destructor

c. main

d. virtual function

  • b. destructor

Q. _________ used to make a copy of one class object from another class object of the sameclass type.

a. constructor

b. copy constructor

c. destructor

d. default constructor

  • b. copy constructor

Q. Constructors __________ to allow different approaches of object construction.

a. cannot overloaded

b. can be overloaded

c. can be called

d. can be nested

  • b. can be overloaded

Q. Which of the following cannot be declared as virtual?

a. Constructor

b. Destructor

c. Data Members

d. Both A and C

  • a. Constructor

Q. It is a __________ error to pass arguments to a destructor.

a. logical

b. virtual

c. syntax

d. linker

  • c. syntax

Q. A __________ is a constructor that either has no parameters, or if it has parameters, all theparameters have default values.

a. default constructor

b. copy constructor

c. Both A and B

d. None of these

  • a. default constructor

Q. How many default constructors per class are possible?

a. Only one

b. Two

c. Three

d. Unlimited

  • a. Only one
Subscribe Now

Get All Updates & News