日期:2014-05-20 浏览次数:20742 次
class Base { public void men1() { System.out.println("base men1 called_______"); } public void men2() { System.out.println("base men2 called_______"); } } class Sub extends Base { private void men1()//报错 { System.out.println("Sub men1 called_______"); } public void men2() { System.out.println("Sub men2 called_______"); } public void men3() { System.out.println("Sub men3 called_______"); } } public class test { public static void main(String arg[]) { Base base=new Sub(); base.men2(); } }