3 回答
TA贡献1804条经验 获得超7个赞
ClassA.class
ClassB.class
ClassB
ClassA
ClassLoaderC
ClassLoaderD
Thread.currentThread().getContextClassLoader()
TA贡献1788条经验 获得超4个赞
ContextClassLoader
getClass().getClassLoader()
ClassLoader
getClass().getClassLoader()
ClassLoader
getClass().getClassLoader()
.
Thread.getContextClassLoader()
, sun.misc.VM.latestUserDefinedLoader()
sun.reflect.Reflection.getCallerClass()
Thread.getContextClassLoader()
ObjectInputStream
ClassLoader
ContextClassLoader
ContextClassLoader null
CLASSPATH
ContextClassLoader
ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); // call some API that uses reflection without taking ClassLoader param} finally { Thread.currentThread().setContextClassLoader(originalClassLoader);}
添加回答
举报