62,625
社区成员
发帖
与我相关
我的任务
分享





public class Pol_ex {
public static void main(String[] args) {
Father f1 = new Father(5);
Father s1 = new Son(3);
System.out.println(s1.fun());
System.out.println(f1.fun());
System.out.println(f1.fun(6));
s1 = f1;
System.out.println(s1.fun());
System.out.println(f1.fun());
System.out.println(f1.fun(6));
}
}
Father s1 = new Son(3);