Vehicle
# speed: int
+ start()
+ stop()
Car
+ openTrunk()
Motorcycle
+ start()
Truck
+ load()
A family tree
1class Vehicle {2 protected int speed;3 void start() { ... }4 void stop() { ... }5}67class Car extends Vehicle { void openTrunk(){...} }8class Truck extends Vehicle { void load(){...} }9class Motorcycle extends Vehicle { void start(){...} } // override
State
# protectedshared with children