TestMultiple.java 463 B

1234567891011121314151617181920212223242526272829
  1. import java.net.*;
  2. public class TestMultiple
  3. {
  4. public static void main (String[] args)
  5. {
  6. URLClassLoader ucl =
  7. (URLClassLoader) ClassLoader.getSystemClassLoader();
  8. URL urls[] = ucl.getURLs ();
  9. MyLoader t1 = new MyLoader (urls);
  10. MyLoader t2 = new MyLoader (urls);
  11. Class c1, c2;
  12. try {
  13. c1 = t1.loadClass ("dummy");
  14. c2 = t2.loadClass ("dummy");
  15. }
  16. catch (Exception e) {
  17. e.printStackTrace ();
  18. }
  19. }
  20. }