O'Reilly logo
  • Shayne Riley thinks this is interesting:

If you are tempted to have a class B extend a class A, ask yourself the question: Is every B really an A? If you cannot truthfully answer yes to this question, B should not extend A


Cover of Effective Java™


There are exceptions to this rule, namely confusing OO for representing real-life objects: For example, mathematically, all squares are rectangles, but you wouldn't want to represent it as such in OO.