13.7 ABSTRACT CLASSES
Object-oriented programming languages define classes so that objects can be declared as those of classes. However, because of inheritance we may be defining some classes such that they serve as base class only. We as programmers are not interested in defining any object of these classes. Such classes are termed as abstract classes. A class, in which a pure virtual function appears, becomes an abstract class. Normally, such a class is used as base class. Therefore, it may also be referred as an abstract base class. We cannot declare objects of this class. The compiler will not allow us to do so.
When a base class has a pure virtual function, every class derived from such base class should redefine this function. Otherwise, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access