1.

Which class is used to design the base class?(a) abstract class(b) derived class(c) base class(d) derived & base classThe question was asked during an interview.I need to ask this question from Abstract Classes topic in portion Derived Classes, Templates & Exception Handling in C++ of C++

Answer»

Right OPTION is (a) abstract class

For EXPLANATION: Abstract class is USED to design base class because functions of abstract class can be OVERRIDDEN in DERIVED class hence derived class from same base class can have common method with different implementation, hence forcing encapsulation.



Discussion

No Comment Found

Related InterviewSolutions