Calculate Polygon Areas using Inheritance
Filed under SAP
The question
Implement child classes Rectangle and Triangle that inherit from a parent class Polygon taking height and width in its constructor, and write functionality to calculate their respective areas.
No write-up yet. Related questions below have one.
Related SAP questions
Collected from public candidate posts and coding forums. Updated Nov 2026.