首页 > 代码库 > 方法的复写demo

方法的复写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");
    }
}

 

方法的复写demo