1.

Which of the following is used to make an abstract class?(a) By using virtual keyword in front of a class declaration(b) By using an abstract keyword in front of a class declaration(c) By declaring a virtual function in a class(d) By declaring a pure virtual function in a classI have been asked this question in exam.The above asked question is from OOPs Concept in section Basics Concepts of C++ of C++

Answer»

Right answer is (d) By DECLARING a pure virtual FUNCTION in a class

Best EXPLANATION: Abstract class should have at least one pure virtual function. Therefore to declare an abstract class one should declare a pure virtual function in a class.



Discussion

No Comment Found

Related InterviewSolutions