Why do you think that? Virtual methods in themselves are just a mechanism for polymorphism. The Liskov Substitution Principle is a just constraint on how you implement the overrides (and other aspects of descendant classes) in order to get predictable polymorphic behaviour.
发布评论
评论(1)
你为什么这么认为?虚方法本身只是多态性的一种机制。 里氏替换原则是对如何实现覆盖(以及后代的其他方面)的公正约束类)以获得可预测的多态行为。
Why do you think that? Virtual methods in themselves are just a mechanism for polymorphism. The Liskov Substitution Principle is a just constraint on how you implement the overrides (and other aspects of descendant classes) in order to get predictable polymorphic behaviour.