wood burning stoves*
The moose likes Java in General and the fly likes To Authors : Class Loader - Why this Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "To Authors : Class Loader - Why this "null"?" Watch "To Authors : Class Loader - Why this "null"?" New topic
Author

To Authors : Class Loader - Why this "null"?

Ramaswamy Srinivasan
Ranch Hand

Joined: Aug 31, 2004
Posts: 295
Hi Authors,

I had a look at the sample chapter. Very interesting. Waiting to get a copy of your work.

I have a question.

I understand that all the classes must have a ClassLoader. But when i try to get the class loader for "java.lang.Object", a null is the result. What does this signify?

Since ClassLoader is a class by iteslf, which class will load the "java.lang.Object", which is the parent, of all the classes.

Thanks for the clarification.

Cheers,
Ram.
[ August 11, 2005: Message edited by: Ramaswamy Srinivasan ]
Joshua Bloch
Author and "Sun God"
Ranch Hand

Joined: May 30, 2001
Posts: 124
Ramaswamy,

For historical reasons, all system classes have a null ClassLoader. It was done this way in the 1.0 release, and various programs depend on it, so compatibility concerns forced the JDK maintainers to keep it that way, even as ClassLoaders were redesigned.

Josh


Joshua Bloch <br />Author of <a href="http://www.amazon.com/exec/obidos/ASIN/0201310058/ref=ase_electricporkchop" target="_blank" rel="nofollow">Effective Java</a> and coauthor of <a href="http://www.amazon.com/exec/obidos/ASIN/032133678X/ref=ase_electricporkchop" target="_blank" rel="nofollow">Java Puzzlers</a>
Ramaswamy Srinivasan
Ranch Hand

Joined: Aug 31, 2004
Posts: 295
Hi Josh,

Thanks for the answer.

Cheers,
Ram.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: To Authors : Class Loader - Why this "null"?