null ClassLoader
Tom Tromey
tromey@redhat.com
Fri Dec 21 08:49:00 GMT 2001
>>>>> "Raif" == Raif S Naffah <raif@fl.net.au> writes:
Raif> for example i might write an application that loads a class with
Raif> the same name, but with different behaviour, from two different
Raif> jars, each with a distinct classloader. i should then be able
Raif> to get two distinct instances of the same class.
Raif> if as it sounds to me, all classes are loaded by the same
Raif> classloader, and in the example above, the second class instance
Raif> (supposedly from the second jar) will not get loaded/created
Raif> which is contrary to the semantics of the classloader.
We're only talking about precompiled classes which are linked into the
application. In this case you can't have multiple class loaders. You
can still use multiple class loaders if you load classes at runtime.
This is true even for compiled classes, if you use Per's shared
library class loader (as opposed to the built-in one).
Tom
More information about the Java
mailing list