import java.net.URL;
import java.net.URLClassLoader;
public class PrintClasspath {
public static void main(String[] args) {
//Get the System Classloader
ClassLoader sysClassLoader = ClassLoader.getSystemClassLoader();
//Get the URLs
URL[] urls = ((URLClassLoader)sysClassLoader).getURLs();
for(int i=0; i< urls.length; i++)
{
System.out.println(urls[i].getFile());
}
}
}
explain the getFile() method......
ReplyDelete@niks2989 : http://download.oracle.com/javase/1.4.2/docs/api/java/net/URL.html#getFile() see this link you will get idea
ReplyDelete