|
Java™ by example!
|
|
|
How do I find out the classloader that loaded a particular class?
You can have your classes loaded by several distinct classloaders. For example, you may have a URLClassLoader that loads your classes over the network. To determine what ClassLoader loaded a particular class, you can invoke getClassLoader on the Class object of that class. This method returns null if the default system classloader was used to load the class. Main.java:
outputs:
Further Information
Author of answer: Joris Van den Bogaert
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|