April 2019
Beginner to intermediate
698 pages
15h 15m
English
We have looked at the way we can create hierarchies of classes to model the system that fits our app. So, let's build a project to improve upon the naval battle we had in the previous chapter.
Create a new project called Basic Classes with Inheritance Example using the Empty Activity template. As you have come to expect, the completed code can be found in the Chapter11 folder.
This is what we are going to do:
Carrier and Destroyer classes into a Ship super class.Ship class for both Carrier and Destroyer, and therefore save a lot of code maintenance.serviceShip function in the Shipyard class so that it takes Ship as a parameter, ...