A Full Solution for a program with four classes, with inheritance.

Scenario: A array of dog objects. Two types of dogs i.e. regular “dogs” and “working dogs”, based on Carol Lewis’ inheritance presentation.

  1. The UI class with the main method
  2. The Manager class with all the relevant methods
  3. The Dog class – the superclass – only three fields – without a trainer
  4. The WorkingDog  class – the subclass – three fields from the superclass plus one extra field ie the trainer

Click here for the solution