class Fu
{
int i = 1;
int k =3;
public void eatFu(){
System.out.println("Fu eat");
}
public void run(){
System.out.println("Fu run");
}
}
class Zi extends Fu
{
int j = 1;
int k =3;
public void eatZi(){
System.out.println("Zi eat");
}
public void run(){
System.out.println("Zi run");
}
}
class DuoTaiDemo {
public static void main(String[] args) {
Fu f = new Zi();
System.out.println(f.i);
//System.out.println(f.j);
System.out.println(f.k);
//f.eatZi();
f.eatFu();
f.run();
}
}
|
|