package com.hy.lrq;
/**
*
* @author 李瑞琦
*
*/
public class TestSuper2 {
public static void main(String[] args) {
ChildrenClass cl = new ChildrenClass();
cl.abc();
}
}
class FatherClass{
public int number;
public void abc(){
this.number= 100;
System.out.println("FatherClass.abc()"+number);
}
}
class ChildrenClass extends FatherClass{
public int number;
public void abc(){
super.abc();
number = 200;
System.out.println("ChildrenClass.abc()"+number);
System.out.println(number);
System.out.println(super.number);
}
}
super关键字深化
最新推荐文章于 2021-07-20 15:45:40 发布