Quote from Wikipedia: Inheritance, even in programming languages that support the use of inheritance as a mechanism that ensures polymorphism of subtypes, does not guarantee the behavioral polymorphism of subtypes; see: “Principle of Substitution” by Barbara Liskov.
What is meant by behavioral polymorphism of subtypes here? How to correctly and concisely answer this question?
I understand it this way: Again, a quote from Wikipedia: In simpler words, we can say that the behavior of inherited classes should not contradict the behavior specified by the base class, that is, the behavior of inherited classes should be expected for code that uses a variable of the base type. It follows from this that inheritance does not protect the programmer from the fact that he can change the behavior in the redefined method. For example, the add() method in the base class adds an object, and you can easily override it and this method will delete an object. Preserving the behavior of the base method is behavioral polymorphism.
Am I right?