日期:2014-05-20 浏览次数:20706 次
public class TestClassCast { public static void main(String[] args) { Son son = new Son(); Base base = new Son(); son.p(10); base.p(10); } } class Base { void p(long a) { System.out.println("Base.P=" + a); } } class Son extends Base { void p(int a) { System.out.println("Son.P=" + a); } }