URLClassLoader: getURLs() : URLClassLoader « java.net « Java by API






URLClassLoader: getURLs()

  
import java.net.URL;
import java.net.URLClassLoader;

public class Main {
  public static void main(String[] args) {
    ClassLoader sysClassLoader = ClassLoader.getSystemClassLoader();
    URL[] urls = ((URLClassLoader) sysClassLoader).getURLs();
    for (int i = 0; i < urls.length; i++) {
      System.out.println(urls[i].getFile());
    }
  }
}

   
    
  








Related examples in the same category

1.new URLClassLoader(URL[] urls)
2.extends URLClassLoader