java - Difference between thread's context class loader and normal classloader -
what difference between thread's context class loader , normal classloader?
that is, if thread.currentthread().getcontextclassloader()
, getclass().getclassloader()
return different class loader objects, 1 used?
each class use own classloader load other classes. if classa.class
references classb.class
classb
needs on classpath of classloader of classa
, or parents.
the thread context classloader current classloader current thread. object can created class in classloaderc
, passed thread owned classloaderd
. in case object needs use thread.currentthread().getcontextclassloader()
directly if wants load resources not available on own classloader.
Comments
Post a Comment