why class objects are referred by class loader ? should it not be other way around i.e. class loader should have been referred
so that class object could have become eligible for GC if class object is unreachable and lesser memory consumption ?
I know i am missing some thing basic here but not sure what. I tried googling it but could not find answered
ClassLoader loads classes and its responsibility is to know what classes it has loaded.
Class objects also have a reference to the
ClassLoader that loaded it, hence the getClassLoader() method in
Memory consumption has absolutely nothing to do with anything here, I can't imagine why you would think it does.