The Problems with Inheritance

  • errors introduced by overriding methods
  • composition
  • forwarding
  • wrapper class
  1. What does it mean for a class B to be a subtype of class A? What are some strategies you can imagine to determine whether every instance of B is really an A?
  2. What happens when you override a method inherited from a superclass? Could you trace a series of method calls made be a subclass B which inherits from and overrides methods in superclass A?

What was particularly interesting, confusing, or exciting to you in this reading?