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.
- The UI class with the main method
- The Manager class with all the relevant methods
- The Dog class – the superclass – only three fields – without a trainer
- The WorkingDog class – the subclass – three fields from the superclass plus one extra field ie the trainer