What is the relationship between abstraction and interfaces in C++? 

  • Interfaces are concrete implementations of abstraction. 
  • Abstraction is achieved using only interfaces. 
  • Interfaces ensure abstraction but not vice versa. 
  • C++ does not have interfaces.
In C++, there isn't a direct concept of "interfaces" as in some other languages. However, abstract classes with only pure virtual functions can act similarly to interfaces. These ensure abstraction by forcing derived classes to provide concrete implementations, but not all abstractions need to be interfaces.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *