Code example for URLClassLoader

Methods: getParent, getURLs

0
    } 
 
    static void loadandrunclass(String classname) throws Exception {
        Class cl = Class.forName(classname);
        URLClassLoader apploader = (URLClassLoader) cl.getClassLoader();
        ClassLoader loader = new URLClassLoader(apploader.getURLs(), apploader.getParent());
        Class c = loader.loadClass(classname);
        Runnable r = (Runnable) c.newInstance();
        r.run();
    } 
 
    public static class lzconI implements Runnable {
        static final int VALUE;
 
        static { 
            int value = 0;
            try { 
                value = Integer.decode(System.getProperty("value"));
            } catch (Throwable e) {}
            VALUE = value;
        }