Does the Liskov Substitution Principle apply to subtype which inherited from abstract class?
- 阅读更多 关于 Does the Liskov Substitution Principle apply to subtype which inherited from abstract class?
问题 loosely speaking, Liskov Substitution Principle states that a derived class can be substitute in place of the base class without affecting the user. In the case when the base class is an abstract class, which means no user is using an instance of the base class, does the Liskov inheritance restrictions still apply to the derived class? 回答1: Just because you can't instantiate a particular class does not mean that you can't use it. In this scenario, the calling code is using the abstract base