Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
621 B
2
Indexable
Never
        URL urlLibraryB = new URL("file:///Users/richardkilvington/NetBeansProjects/roulette/target/roulette-1.0-SNAPSHOT.jar");

        // Create separate class loaders for Library B and Library C
        ClassLoader classLoaderB = new URLClassLoader(new URL[]{urlLibraryB});

        // Load classes from Library B using its class loader
        Class<?> classB = classLoaderB.loadClass("com.mycompany.roulette.Roulette");
        // Instantiate and use classB as needed
        Object newInstance = classB.newInstance();
        
        String toString = newInstance.toString();
        System.out.println(toString);
Leave a Comment