day27 Java learning reflection

Reflection (class loading and loading time)

 

      Load overview class:

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

       load:

                * Refers to the class file is read into memory, and whom to create a Class object, the system will build a Class object when any class is used.

       connection:

                * Validation: Is there a correct internal structure and coherence, and other classes.

                * Preparation: Responsible to allocate memory for a static member of a class, and set the default initialization values.

                * Analysis: class binary data symbols replace references to direct reference.

       initialization

 

     Load opportunity:

                 * Create an instance of the class.

                * Access to the class static variable or static variable assignment.

                * Static method call class.

                * 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 Java.exe use a command to run a master class.

 

 

Reflection (Overview class loader and classification)

     Class loader Overview:

                * Responsible for loading. Class files into memory for, and generate the corresponding Class object.           

 

Guess you like

Origin www.cnblogs.com/feng0001/p/10992410.html