4 Abstract Class and Interface
4 Abstract Class and Interface
Abstract Class
• An abstract class is, conceptually
– A class that cannot be instantiated and is usually implemented as
a class that has one or more pure virtual (abstract) functions
Output:
• Interface does not have defined variables. Abstract class can have variable
declaration and method implementation/declarations. Moreover an
abstract class may be inherited without implementing the abstract
methods.
• If the derived class does not implement the pure virtual function of parent
class then the derived class becomes abstract