This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Ramaswamy Srinivasan
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ramaswamy Srinivasan
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Josh,

Thanks for the answer.

Cheers,
Ram.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic