What is abstract class?
- Abstract classes are mainly used in inheritance and cannot be instantiated. They are used as base classes and contain at least one pure virtual function.
-
Example :class AB
{
public:
virtual void f() = 0;
};
What is abstract class?
- A class whose object can't be created is abstract class. You can create a class as abstract by declaring one or more virtual functions to pure.
- Pure virtual functions are declared as below :
virtual void show() = 0 ;