标题: 不经意间又看到这道经典的面试题!! [打印本页] 作者: 小穿钉 时间: 2015-11-9 09:04 标题: 不经意间又看到这道经典的面试题!! package test;
public class Test4 {
public static void main(String[] args) {
new ZiLei();
}
}
class FuLei {
LinShi ls = new LinShi("1");
static
{System.out.println("2");}
{System.out.println("3");}
public FuLei() {
System.out.println("4");
}
}
class ZiLei extends FuLei{
LinShi ls = new LinShi("5");
static
{System.out.println("6");}
{System.out.println("7");}
public ZiLei() {
System.out.println("8");
}
}
class LinShi {
public LinShi(String str) {
System.out.println(str);
}
}
写出你的答案,回顾一下基础