62,614
社区成员
发帖
与我相关
我的任务
分享
class Person{
private void print(){
System.out.println("父类的print方法");
};
public void fun(){
this.print();
}
}
class Student extends Person{
void print(){
System.out.println("子类的print方法");
}
}
public class Demo{
public static void main(String args[]){
Student s = new Student();
s.fun();
}
}