jvm - i think it is enough that only one kind of classloader in java -
there multiple subclasses of classloader: bootstrapclassloader,extclassloader,appclassloader , on.
however, think 1 bootstrapclassloader enough!
can please tell me why there many different kinds of classloaders?
notice: why there many kinds of classloaders, not why there many instances of classloader!
each class loader designed load classes different locations. instance, can create class loader load class file networked server or download binary of class remote web server, etc. logic performs operation baked class loader , provides consistent interface clients can load classes regardless of how class loader performs loading. bootstrapclassloader capable of loading classes jvm_home/lib directory...but if need load them different location??
in short, because there infinite (well, not quite) number of ways load classes , there needs flexible system allow developers load them want.
Comments
Post a Comment