父类和子类

public class Father {
public void FF1(){
System.out.println("我是FF1");
}
public void FF2(){
System.out.println("我是FF2");
}
}

public class Son extends Father {
public void FF2(){
System.out.println("我是Son的FF2");
}

}

public class test06 {

public static void main(String[] args) {

Father f=new Son();
f.FF2();

}

}

原文地址:https://www.cnblogs.com/lizhe313/p/5264224.html