Extends
Extends
π¨βπΌ Let's build a shape hierarchy. We'll create a base
Shape class and extend
it with specific shapes like Circle and Rectangle.π¨ Open
and:
- Create a
Shapebase class with acolorfield - Create a
Circleclass that extendsShape - Add a
radiusfield toCircle - Create a
Rectangleclass that extendsShape - Add
widthandheightfields toRectangle