Top 80+ Solved Object Oriented Programming (OOP) MCQ Questions Answer
Q. What is the difference between struct and class in terms of Access Modifier?
a. by default all the struct members are private while by default class members are public.
b. by default all the struct members are protected while by default class members are private.
c. by default all the struct members are public while by default class members are private.
d. by default all the struct members are public while by default class members are protecte
Q. The default access level assigned to members of a class is
a. private
b. public
c. protected
d. needs to be assigned
Q. Which type of class has only one unique value for all the objects of that same class?
a. this
b. friend
c. static
d. both a and b
Q. Which one of the following is not a fundamental data type in C++?
a. float
b. string
c. int
d. char
Q. What is a constructor?
a. a class automatically called whenever a new object of this class is created.
b. a class automatically called whenever a new object of this class is destroyed.
c. a function automatically called whenever a new object of this class is created.
d. a function automatically called whenever a new object of this class is destroye
Q. Under what conditions a destructor destroys an object?
a. scope of existence has finished
b. object dynamically assigned and it is released using the operator delete.
c. program terminated.
d. both a and b.
Q. When class B is inherited from class A, what is the order in which the constructers of those classes are called
a. class a first class b next
b. class b first class a next
c. class b's only as it is the child class
d. class a's only as it is the parent class
Q. Which one of the following is not a valid reserved keyword in C++?
a. explicit
b. public
c. implicit
d. private
Q. In a class definition, data or functions designated private are accessible
a. to any function in the program.
b. only if you know the password.
c. to member functions of that class.
d. only to public members of the class.