<分区>
Possible Duplicate:
Is deriving square from rectangle a violation of Liskov's Substitution Principle?
通过应用 LSP,谁能给我一个 Square 和 Rectangle 的实现?
我看过《Head First Object-Oriented Analysis and Design》这本书,他们说如果 Sqaure 继承自 Rectangle,它违反了 LSP 但没有正确的实现。
有人想试试吗?