Search⌘ K

Challenge 2: Implement and Override the Method

Explore how to override the getArea method in a Circle class that extends Shape to calculate area using polymorphism. Learn to design an algorithm and implement method overriding to increase code flexibility and modularity.

Problem Statement #

Write a method in a Circle class which overrides a method in a Shape class i.e. getArea() and returns the area of a circle.

The value of Pi is 3.14. ...