public class Test{
public static void main(String... args){
Test test = new Test();
Class testClass = Test.class;
}
}
As i know, if jvm want to GC Test class, it must meet below conditions:
all instances of Test have already GC'ed.
Test's class loader has GC'ed.
Test cannot be reflected at anywhere(i am not sure about this condition)
so, my question are,
does jvm need testClass object GC'ed or testClass GC after Test GC'ed?
what situation class loader will be GC'ed
explain more about condition 3
does it enough of conditions which listed?