1. The meaning of reflection is to load the external class into the virtual machine
2. Once a class is loaded into the JVM, initialization of the class is performed. such as static loading
3. The first step to run a program when class loads
4.java HelloWorld
command, the JVM loads the Helloworld.class into memory and forms a class object helloworld.class. 5. The class load, which is loaded by the ClassLoader. The JVM loads classes through the class loader. 6. Class loading complete regrets generating a class object in memory 7.1, when running a program, is always loaded by Appclass Loader (System ClassLoader) to start loading the specified class. 2. When the class is loaded, each classloader will hand the load task to its parent, if the parent cannot find it, and then load it by itself.
3, Bootstrap Loader (startup class loader) is the top class loader, and its parent loader is null. 9. If the class does not load, it will report ClassNotFound exception Ah, this is a typical IO exception ah 10. Your program can load classes or interfaces that are not known or exist at compile time, and dynamically connect them and perform selective parsing. 8.public class HelloWorld {
public static void Main (string[] args) {
HelloWorld Hello = new HelloWorld ();
Class C = Hello.getclass ();
ClassLoader loader = C.getclassloader ();
SYSTEM.OUT.PRINTLN (loader);
System.out.println (Loader.getparent ());
System.out.println (Loader.getparent (). GetParent ());
}
When the program runs, the class must be loaded. Loading a class is the first step in a program's run. Since the class has already been loaded, there must be class object 9 in memory. How do I dynamically load a class into the JVM? A: Class load class loading There are three ways: 1, the command line starts the application by the JVM initialization load 2, through the Class.forName () method dynamic loading 3, through the Classloader.loadclass () method dynamic loading
Java Reflection Comprehension