class Loading:
Class loading mechanism refers to the. class file loaded into the JVM, and the formation of a class object mechanism, then the application can be instantiated and called Class object, the class loading mechanism can dynamically load external classes at run time, remote network downloaded from the class file, in addition to the advantages of the dynamic, but also through the JVM class loading mechanism To achieve the effect of class isolation, such as the classes in the Acclication server that typically have two applications interfering with each other.
The JVM transforms the class loading process into three steps, load, link, initialize, mount, and link completion, the binary bytecode is converted to class object, the initialization process must not be triggered when the class is loaded, but must be executed at the latest before the first active use of the object, its action is to assign a value to the static variable, call <client> () and so on.
The process is as follows:1. Load (load)
The load process is responsible for locating the binary bytecode and loading into the JVM, and the JVM completes the class loading through the class's fully qualified name (Com.luna.HelloWorld) and the class loader (ClassLoader a instance), again The above two elements are also used to identify a loaded class: the fully qualified name of the class +classloader the instance ID. The class name is named in the following way:
For interfaces or non-array classes, the name is the class name, and this type of class is loaded by the ClassLoader
For array-type classes, the name is the base type or L + reference type name, for example: byte[] bytes=new byte[512], the bytes class name is: object[] objects=new object[10],objects
Loading mechanism like "Java"