What is the characteristic of classes that have pure virtual functions?
Each descendant of an abstract class (the class containing "pure virtual" functions) is also an abstract class unless an implementation for all "pure virtual" functions of its ancestor is provided. Objects of abstract types can not be created. An exception of all the possible "pure virtual functions" is the destructor, that being "pure virtual" will be automatically overloaded by descendants and will stop being "pure virtual". Thus the descendants of the abstract class, which have only "pure virtual" destructor, will not be abstract. This programming pattern is used when creating a class hierarchy in which it is forbidden to create objects of the top class in the hierarchy but is allowed to create objects inherited from that class.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Sign Up Now
or Subscribe for future quizzes