null ClassLoader

Torsten Rüger torsten.rueger@firsthop.com
Fri Oct 26 07:38:00 GMT 2001


> This has been discussed before...

Yes, but it hasn't been implemented. Why ? Such a small thing.


> Do you know of any VM that doesn't print "null" with:

No, I'll have to correct myself.

> public class T {
>   public static void main(String[] args) {
>     System.out.println(Object.class.getClassLoader());
>   }
> }

But this is not a very relevant question. Anything in the java* 
namespace is loaded by the bootstrap loader. It says that in the spec.

But try the more interesting:

public class T {
   public static void main(String[] args) {
     System.out.println(T.class.getClassLoader());
   }
}

I only found an old 1.1 jdk that returned null on that. All newer 
(1.2/3/4) sun and ibm jdk's return a value.

Torsten



More information about the Java mailing list