摘要: 在网上看到一篇面试题,题目如下:写出下列代码的运行结果: 1 public class DispatchTest { 2 public static void main(String[] args) { 3 Base b = new Sub(); 4 System.out.println(b.x); 5 } 6 } 7 8 class Base { 9 int x = 10;10 11 public Base() {12 this.printMessage();13 x = 20;14 }... 阅读全文
posted @ 2013-08-10 22:25 画水 阅读(329) 评论(0) 推荐(0) 编辑