2019-06-06 Java reflective learning diary day27

Overview timing of load and load class

Class loading

  * When you want to use a class if the class is not loaded into memory, the system by loading, connect, initialize three steps to achieve this class is initialized

  *load

    * Refers to the class to read the file into memory, and whom to create a class object. When any type of system would be used to create a class object

  *connection

    * Verify that you have the correct internal structure, and coordinated with other classes

    * Responsible for preparing the static member of a class of allocating memory, and set the default initialization value

    * Analytical binary data class is replaced symbolic references direct reference

  *initialization 

Load opportunity

  * Create an instance of the class

  * Access class static variable or static variable assignment

  * Using a reflection mode to force the creation of a class or interface objects corresponding java.lang.class

  * Initialize the subclass of a class

  * Direct use java.exe command to run a master class

 

Class loader and classification

 Class loader

  * .Class responsible for loading the file into memory for, and generate the corresponding class object. Although we do not care about class loading mechanism, but understand this mechanism we can run a better understanding of the program

 Classification class loader

  * Bootstrap ClassLoader root class loader

  * Extension ClassLoader extension class loader

  * System ClassLoader system class loader

 Acting class loader

  * Bootstrap ClassLoader root class loader

    Also known as the bootstrap class loader is responsible for loading Java core class

    For example System.String etc., in the JDk

Guess you like

Origin www.cnblogs.com/JungTan0113/p/10992350.html