This is an example of inheritance.
Here are UML diagrams describing the MilleniumFalcon and Spaceship classes:
Note the way IS-A and HAS-A relationships are illustrated on a uml diagram.
We will analyse these classes and review some of the concepts that we have covered so far in Object Oriented Programming.
Complete the exam questions.
Inheritance reduces the amount of code that needs to be written. It promotes code reuse.
Inheritance reduces the amount of maintenance required because often only the superclass code needs to be altered.
Inheritance can result in complex class heirarchies.
Make sure you can define each of the following terms clearly:
This can be printed out and given to students as a pair activity.
classprivate public protected static final method constructor encapsulation mutator data-hiding accessormodifiers