日期:2014-05-20 浏览次数:20818 次
public class SuperTest {
public static void main(String[] args) {
Child c = new Child();
c.addAll();
}
}
class Parent{
public void add(){
System.out.println("A add...");
}
public void addAll(){
System.out.println("A add ALL...");
this.add();
}
}
class Child extends Parent{
@Override
public void add() {
// TODO Auto-generated method stub
System.out.println("B add...");
super.add();
}
@Override
public void addAll() {
// TODO Auto-generated method stub
System.out.println("B add ALL...");
super.addAll();
}
}
public class SuperTest {
public static void main(String[] args) {
Child c = new Child();
c.addAll();
}
}
class Parent{
public void add(){
System.out.println("A add...");
}
public void addAll(){
System.out.println("A add ALL...");
//加上下面这句话 你的世界就变的清晰了 肯定就明白了