<! -- [If gte mso 9]> <! [Endif] --> <! -- [If gte mso 9]> <! [Endif] --> <! -- [If gte mso 10]>
<! [Endif] -->
Class Loader
The custom ClassLoader must inherit the ClassLoader class and override the findClass method of the parent class. Because the loadClass method contains the delegate mechanism of the Class Loader, we still retain the loadClass method of the parent class, then, use defineClass to load the class file to the memory through the byte stream. because of the delegate mechanism, we need to put the class file to be loaded under the directory we specified, so that when the parent class loader cannot find the file to be loaded, there will be our custom class loaders for loading.
When a class is loaded by the parent class of its loader class, the parent loader also loads all classes associated with the class. Otherwise, an error occurs. because when class A references Class B, Class B is loaded by the class loader of Class, therefore, Class A cannot be loaded if Class B is not found when the class loader loads Class.
Example of myServlet