jeudi 27 juin 2019

liskov substitution principle again - each method overriding violates the principle

I know there is many similar subjects but I need to ask because the rule is "If class S is a subtype of class T, then instances of T may be replaced by instances of S without altering any of the desirable behaviors of T itself." - so each method overriding violates the rule. Am I wrong? Because each method overriding alters base class. If not - please give the example.

Aucun commentaire:

Enregistrer un commentaire