java 子类继承父类
public class day_6_25 {
public static void main(String[] args){
Zi zi = new Zi();
zi.getName();
};
}
/*
在子父类继承
*/
class Fu{
String name = "张三";
public void setName(){
System.out.println("我是"+name);
}
}
class Zi extends Fu{
public void getName(){
super.setName();
System.out.println(super.name);
};
}