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



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

Answer / 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

More C++ General Interview Questions

What is a concrete class?

1 Answers  


If dog is a friend of boy, is boy a friend of dog?

0 Answers  


What is cin clear () in c++?

0 Answers  


Explain the isa and hasa class relationships. How would you implement each?

0 Answers  


Specify different types of decision control statements?

0 Answers  






what is smart pointer & use of the smart pointer ???

2 Answers  


Given the following seqment of code containing a group of nested if instructions: y = 9; if ((x==3) || (x == 5)) y++; else if (x == 2) y *= 2; else if (x == 4 ) y-= 7; else y = 8; Enter a segment of code (without any IF statements) that does exectly the same thing using the switch structure.

1 Answers  


write a program in c++ to implement stack using functions in header file stack.h

3 Answers   Google, Subex,


what is the order of initialization for data?

10 Answers   Amazon, TCS, Wipro,


What is the need of a destructor?

0 Answers  


How can you differentiate between inheritance and implementation in c++?

0 Answers  


What are the implicit member functions of class?

0 Answers  


Categories