组成意味着
HAS A
继承
IS A
Example:汽车有发动机,汽车是汽车
在编程中,它表示为:
class Engine {} // The Engine class.class Automobile {} // Automobile class which is parent to Car class.class Car extends Automobile { // Car is an Automobile, so Car class extends Automobile class. private Engine engine; // Car has an Engine so, Car class has an instance of Engine class as its member.}


