方法的复写demo

package jichengdemo;

public class FuXieDemo {
public static void main(String[] args) {
    new studentww().fun();
}
}
class personmm{
    
    void print(){
        System.out.println("person  print");
    }
    public void fun(){
        print();
    }
}
class studentww extends personmm{
    public void print(){
        System.out.println("student print");
    }
}

 

posted @ 2017-03-16 19:55  初学者,方圆几里  阅读(105)  评论(0编辑  收藏  举报