没有继承没有多态
相近子类提取共性属性方法生成父类 继承父类拥有父类属性方法
子类包含父类
封装隐藏属性
public class Person {
public string name;
public int age;
public void sayHi(){
}
}
public class Engineer extends Person
{
public string programme;
public void sayHi(){
}
}
public class Musician extends Person{
public string piano;