First page Back Continue Last page Graphics
Extending is simpler in OOP
Compared to Procedure Oriented Programing extending code in Object Oriented Programming is simpler.
For adding support for Triangle you will write
- Triangle Interface, class implementation
- Creating and adding Triangle object in main function.
draw function inside all the objects automatically prints the state of object.
Later in Inheritance we'll learn how to push repetitive code blocks in base class and inherit.