为什么子类继承上一个子类情况下在下面这个子类里面无法添加静态初始块
package lee;class Root {
static{
System.out.println("Root静态初始模块");
}
{
System.out.println("Root普通初始模块");
}
public Root()
{
System.out.println("Roor的无参数构造器");
}
class Mid extends Root
{
}
static{
System .out.println("Mid的静态初始");
}
{
System.out.println("Mid的静态初始");
}
public void Mid()
{
System.out.println("Min无参数构造器");
}
public void Mid(String msg)
{
System.out.println("vg");
}
class gsd extends Mid
{
static{
System.out.println("gsd静态初始");
}
}
{
System.out.println("Leaf普通初始模块");
}
public class Test
{
}
public static void main(String[] args)
{
new Leaf();
new Leaf();
}
}