Created
December 17, 2015 19:58
-
-
Save bzdgn/bd56dba6e2a042a18d09 to your computer and use it in GitHub Desktop.
ClassLoader Hierarchy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.levent; | |
import java.net.URL; | |
import java.net.URLClassLoader; | |
public class DelegationClasses { | |
public static void main(String[] args) { | |
URLClassLoader classLoader = (URLClassLoader) ClassLoader.getSystemClassLoader(); | |
do{ | |
System.out.println("Class Loader: " + classLoader); | |
for (URL url : classLoader.getURLs()) { | |
System.out.printf("\t %s\n", url.getPath()); | |
} | |
} while ((classLoader = (URLClassLoader) classLoader.getParent()) != null); | |
System.out.println("Class Loader: Bootstrap classLoader"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output;