What is "polymorphism" in OOP
Polymorphism is the property of a system to use objects with the same interface without information about the type and internal structure of the object. The advantage of polymorphism is that it helps reduce program complexity by allowing the same interface to be used to define a single set of actions. The choice of a specific action, depending on the situation, rests with the compiler of the programming language. Hence the key feature of polymorphism is the use of an object of a derived class, instead of an object of the base class (descendants can change their parent behavior, even if they are accessed by reference of the parent type). Any training in driving would not make sense if a person who learned to drive, say, a VAZ 2106 could not then drive a VAZ 2110 or BMW X3. On the other hand, it is difficult to imagine a person who could normally drive a car in which the gas pedal is to the left of the brake pedal, and instead of the steering wheel there is a joystick. The thing is t...