Twenty-fifth

package practice;

public class one {
    Object get() {
        return null;
    }
}
class two extends one {
    Integer get() {
        return new Integer(100);    
    }
}
public class Example {
    public static void main(String args[ ]) {
        B b=new B();
        Integer t=b.get();
        System.out.println(t.intValue());
    }
}
 

猜你喜欢

转载自blog.csdn.net/sutiesenn/article/details/82947852