It would be better if all specific area calculation methods could be called getArea(). You would only have to remember one method name and when you call that method, the method specific to that object would be called. This can be achieved in object-oriented programming using polymorphism. The base class declares a function without providing an implementation. Each derived class inherits the function declaration and can provide its own implementation
Consider that the Shape class has a method called getArea(), which is inherited by all subclasses mentioned. With polymorphism, each subclass may have its own way of implementing the method. For example, when the getArea() method is called on an object of the Rectangle class, the method will respond by displaying the area of the rectangle. On the other hand, when the same method is called on an object of the Circle class, the circle’s area will be calculated and displayed on the screen.