What is "polymorphism"

In object-oriented programming, the polymorphism allows references of more abstract class types to represent the behavior of the concrete classes they reference. Thus, it is possible to treat several types homogeneously (through the more abstract type interface). The term polymorphism originates from Greek and means "many forms" (poly = many, Morphos = forms).

Polymorphism is characterized when two or more distinct classes have methods of the same name, so that a function can use an object of any of the polymorphic classes, with no need to treat differently according to the object class.

One of the ways to implement polymorphism is through an abstract class, whose methods are declared but not defined, and through classes that inherit the methods of this abstract class.

Source: Polymorphism - Wikipedia