JAVA代码执行顺序
发布时间
阅读量:
阅读量
代码执行顺序的题目
public class TestClass {
static class Father{
public int money = 1;
public Father() {
this.money = 2;
showMoney();
}
protected void showMoney(){
System.out.println("I am Father , I hava $"+money);
}
}
static class Son extends Father{
public int money = 3;
public Son() {
this.money = 4;
showMoney();
}
protected void showMoney(){
System.out.println("I am Son , I hava $"+money);
}
全部评论 (0)
还没有任何评论哟~
