What is an ABC: an "Abstract Base Class"?

Answer Posted / rohit sah

An Abstract Base Class is a class that is not intended to be instantiated itself. Rather, it is intended strictly for use as a base for other classes. To prevent instantiation, an ABC will typically contain at least one pure virtual function.

The point of an ABC is to separate the interface of a group of classes from the implementation of the functions that make up the interface. This allows other code to ignore differences in how these functions are carried out. An ABC creates a contract between its descendants and any other code that uses them. The descendants must implement a certain set of functions. Code that uses them must use those functions to access whatever it is the object involved represents.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Mention the ways in which parameterized can be invoked. Give an example of each.

576


What is a manipulator in c++?

717


Why is c++ is better than c?

519


Will a C compiler always compile C++ code a) Yes b) No c) Only optimized compilers

617


What is a dynamic binding in c++?

538






What is an accessor in c++?

621


What is pointer to member?

603


What is microsoft c++ redistributable?

617


Why use of template is better than a base class?

649


Is it possible to have a recursive inline function in c++?

560


Why is it necessary to use a reference in the argument to the copy constructor?

637


Why c++ is better than c language?

567


Does c++ have finally?

571


Why isn't sizeof for a struct equal to the sum of sizeof of each member?

544


How long it will take to learn c++?

618