C++ | Virtual Functions | Question 4

Which of the following is true about pure virtual functions?

1) Their implementation is not provided in a class where they are declared.
2) If a class has a pure virtual function, then the class becomes abstract class and an instance of this class cannot be created.
(A) Both 1 and 2
(B) Only 1
(C) Only 2
(D) Neither 1 nor 2


Answer: (A)

Explanation: See http://en.wikipedia.org/wiki/Virtual_function#Abstract_classes_and_pure_virtual_functions
See http://stackoverflow.com/questions/5481941/c-pure-virtual-function-have-body

Quiz of this Question

Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.

My Personal Notes arrow_drop_up

Improved By : yaroslavpalamar