Nature created an array of JVM

1. Create an array

Create a MyParent4 [] array

public class MyTest4 {

    public static void main(String[] args) {
        MyParent4[] myParent4s = new MyParent4[1];
        System.out.println(myParent4s.getClass());
    }
}

class MyParent4{

    static {
        System.out.println("MyParent4 static block");
    }

}

  Print the structure

  Description here is not in line with the initiative to use the scenes, all is not initialized MyParent4. Print myParent4s.getClass () is an array type. [Lcom.example.jvm.classloader.MyParent4 this type is created out of the JVM at runtime.

Guess you like

Origin www.cnblogs.com/linlf03/p/10990145.html