Top 80+ Solved Object Oriented Programming (OOP) MCQ Questions Answer

From 76 to 90 of 94

Q. The main intention of using inheritance is ….........

a. to help in converting one data type to other

b. to hide the details of base class

c. to extend the capabilities of base class

d. to help in modular programming

  • c. to extend the capabilities of base class

Q. If particular software can be used in some other application than the one for which it is created then it reveals ….........

a. data binding

b. data reusability

c. data encapsulation

d. none of these

  • b. data reusability

Q. Which of the following data type does not return anything?

a. int

b. short

c. long

d. void

  • d. void

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 interface determines how your program will be used by other program?

a. public

b. private

c. protected

d. none of these

  • a. public

Q. What is the difference between struct and class in C++?

a. all members of a structure are public and structures don't have constructors and destructors

b. members of a class are private by default and members of struct are public by default. when deriving a struct from a class/struct, default access-specifier for a base class/struct is public and when deriving a class, default access specifier is private.

c. all members of a structure are public and structures don't have virtual functions

d. all above

  • b. members of a class are private by default and members of struct are public by default. when deriving a struct from a class/struct, default access-specifier for a base class/struct is public and when deriving a class, default access specifier is private.

Q. class Test { int x;};int main(){Test t; cout <<t.x; return 0;}

a. 0

b. garbage value

  • c. compile time error

Q. What happens when delete is used for a NULL pointer? int *ptr = NULL;delete ptr;

a. compile time error

b. run time error

  • c. no effect

Q. Which of the followings is/are automatically added to every class, if we do not write our own.

a. copy constructor

b. assignment operator

c. a constructor without any parameter

d. all

  • d. all
Subscribe Now

Get All Updates & News