The concept of abstract classes is an extension to the concept of inheritance. In inheritance the parent classes can be defined with attributes that are commonly required under multiple child classes providing reusability.
FIGURE
FIGURE
- Rectangle
- Circle
- Triangle
- Cone
The class Figure as it is the parent provides the attributes commonly required to all figures given reusability. Along with this we can also define any abstract in the parent class figure so that the child classes will implement the abstract members which is a restriction for the child classes and cannot escape from it.
No comments:
Post a Comment