Top 80+ Solved Object Oriented Programming In cpp MCQ Questions Answer
Q. How do we declare an abstract class?
a. by providing at least one pure virtual method (function signature followed by ==0;) in a class
b. by declaring at least one method abstract using the keyword ‘abstract’ in a class
c. by declaring the class abstract with the keyword ‘abstract’
d. it is not possible to create abstract classes in c++
Q. Which of the following is not an advantage of secondary memory
a. it is cost-effective
b. it has large storage capacity
c. it has highest speed
d. it is easily portable
Q. What happens when a pointer is deleted twice?
a. it can abort the program
b. it can cause a failure
c. it can cause an error
d. it can cause a trap
Q. Which of the following language feature is not an access specifier in C++?
a. public
b. private
c. c protected
d. internal
Q. Expression C=i++ causes
a. value of i assigned to c and then i incremented by 1
b. i to be incremented by 1 and then value of i assigned to c
c. value of i assigned to c
d. i to be incremented by 1
Q. Which of the following library function below by default aborts the program?
a. terminate()
b. end()
c. abort()
d. exit()
Q. If a member needs to have unique value for all the objects of that same class, declare the member as
a. global variable outside class
b. local variable inside constructor
c. static variable inside class
d. dynamic variable inside class
Q. Value of ix+j, if i,j are integer type and ix long type would be
a. integer
b. float
c. long integer
d. double percision
Q. Which of the following below can perform conversions between pointers to related classes?
a. cast_static
b. dynamic_cast
c. static_cast
d. cast_dynamic
Q. Vtables
a. creates a static table per class
b. creates a static table per object
c. creates a dynamic table per class
d. creates a dynamic table per object
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 of the following is the most general exception handler that catches exception of any type?
a. catch(std::exception)
b. catch(std::any_exception)
c. catch(…)
d. catch()