The document defines an abstract class 'Shape' with a method 'Area' and three subclasses: 'Circle', 'Rectangle', and 'Triangle', each implementing the 'Area' method to calculate their respective areas. The 'Main' class demonstrates the use of these shapes by creating instances of each and calling their area methods. The program outputs the area of a circle, rectangle, and triangle based on the provided dimensions.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
0 views
Se
The document defines an abstract class 'Shape' with a method 'Area' and three subclasses: 'Circle', 'Rectangle', and 'Triangle', each implementing the 'Area' method to calculate their respective areas. The 'Main' class demonstrates the use of these shapes by creating instances of each and calling their area methods. The program outputs the area of a circle, rectangle, and triangle based on the provided dimensions.