继承
继承的好处1:不改变原来模型的基础上,拓充方法2:建立了类与类之间的关系3:抽取了公共代码继承的坏处耦合性强
继承的使用场合1:当两个类拥有相同属性和方法的时候,就可以把相同的抽取一个父类中;2:当A类中拥有B类中的部分属性和方法,可以让B类继承于A类。