当前位置: 代码迷 >> J2EE >> 今日面试题
  详细解决方案

今日面试题

热度:23   发布时间:2016-04-22 01:11:13.0
今天面试题
public class A extends B {
  public A(){
  System.out.println("cccc");
  }
  public void say(){
  System.out.println("hello,a");
  }
   
}
class B{
  static {
  System.out.println("aaa");
  }

  public B() {
  System.out.println("bbb");
  }
  public void say(){
  System.out.println("hello,b");
  }
}

测试类{
  public static void main(String[] args) {
  B b =new A();
  b.say();
  }

}

------解决方案--------------------
aaa
bbb
cccc
hello,a
  相关解决方案