当前位置:编程学习 > JAVA >>

JAVA2编写问题

请问一下:运行结果是不是0 0 2 4 0 class father { int x=0; public void output() { System.out.println(x); } } class son extends Father { int x=2; public void output(int x) { super.output(); System.out.printin(this.x); System.out.println(x); System.out.println(super.x); } } class Exclass { public static void main(Strin args[]) { Father obfather=new Father(); obfather.output(); Son obson=new son(); obson.output(4); } }
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,