Replace the classLoader used by the new object to load the class

When

new MyClassType (), the class is loaded into the virtual machine. Normally, can Launcher$AppClassLoaderClassLoader, be replaced with a custom class loader with a context class loader (Thread.contextClassLoader)?

related codes

    AThread a=new AThread();
    a.setContextClassLoader(new AclassLoader());
    a.start();
May.22,2021
Menu