Question: Write an abstract superclass encapsulating a shape: A shape has two abstract methods: one returning the perimeter of the shape, another returning the area of
Write an abstract superclass encapsulating a shape: A shape has two abstract methods: one returning the perimeter of the shape, another returning the area of the shape. It also has a constant field named PI. This class has two non-abstract subclasses: one encapsulating a circle, and the other encapsulating a rectangle. A circle has one additional attribute, its radius. A rectangle has two additional attributes, its width and height. You also need to include a client class to test these two classes.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
