父类和子类

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();

}

}

posted @ 2016-03-11 08:34  lizhe313  阅读(99)  评论(0编辑  收藏  举报