Practice ยท 1 of 2
Polymorphic shapes
Inside Solution, write static abstract class Shape with abstract double area() and String name(); plus static class Circle extends Shape (constructor takes radius), static class Rect extends Shape (width, height). Implement static double totalArea(Shape[] shapes) that works for ANY mix of shapes.
Difficulty: beginner
Press Submit to check your solution.
Back to lesson: Practice: Practice: Designing with Polymorphism