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

From 46 to 60 of 134

Q. The break statement causes an exit

a. from the innermost loop only.

b. only from the innermost switch.

c. from all loops & switches.

d. from the innermost loop or switch.

  • c. from all loops & switches.

Q. The arrays of variable that are of the type class

a. Array of object

b. pointer

c. Object

d. Structure

  • a. Array of object

Q. Which of the following is not a type of constructor?

a. Copy constructor

b. Friend constructor

c. Default constructor

d. Parameterized construct

  • b. Friend constructor

Q. Which of the following statements is incorrect?

a. Friend keyword can be used in the class to allow access to another class.

b. Friend keyword can be used for a function in the public section of a class.

c. Friend keyword can be used for a function in the private section of a class.

d. Friend keyword can be used on main().

  • d. Friend keyword can be used on main().

Q. Which of the following statement is correct regarding destructor of base class?

a. Destructor of base class should always be static.

b. Destructor of base class should always be virtual.

c. Destructor of base class should not be virtual.

d. Destructor of base class should always be private.

  • b. Destructor of base class should always be virtual.

Q. How can we make a class abstract?

a. By making all member functions constant.

b. By making at least one member function as pure virtual function.

c. By declaring it abstract using the static keyword.

d. By declaring it abstract using the virtual keywor

  • b. By making at least one member function as pure virtual function.

Q. Which of the following statements is correct when a class is inherited publicly?

a. Public members of the base class become protected members of derived class.

b. Public members of the base class become private members of derived class.

c. Private members of the base class become protected members of derived class.

d. Public members of the base class become public members of derived class.

  • d. Public members of the base class become public members of derived class.

Q. Which of the following access specifies is used in a class definition by default?

a. Protected

b. Public

c. Private

d. Friend

  • c. Private

Q. Which of the following statement is correct with respect to the use of friend keyword insidea class?

a. A private data member can be declared as a friend.

b. A class may be declared as a friend.

c. An object may be declared as a friend.

d. We can use friend keyword as a class name.

  • b. A class may be declared as a friend.

Q. Which of the following keywords is used to control access to a class member?

a. Default

b. Break

c. Protected

d. Asm

  • c. Protected

Q. Which of the following type of data member can be shared by all instances of its class?

a. Public

b. Inherited

c. Static

d. Friend

  • c. Static

Q. Constructor is executed when _____.

a. an object is created

b. an object is used

c. a class is declared

d. an object goes out of scope.

  • a. an object is created

Q. Which of the following also known as an instance of a class?

a. Friend Functions

b. Object

c. Member Functions

d. Member Variables

  • b. Object

Q. How many objects can be created from an abstract class?

a. Zero

b. One

c. Two

d. As many as we want

  • a. Zero

Q. Which of the following statements is correct?

a. Data items in a class must be private.

b. Both data and functions can be either private or public.

c. Member functions of a class must be private.

d. Constructor of a class cannot be private.

  • b. Both data and functions can be either private or public.
Subscribe Now

Get All Updates & News