File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Why Objcet is the Base class? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Why Objcet is the Base class?" Watch "Why Objcet is the Base class?" New topic
Author

Why Objcet is the Base class?

Santosh Maskar
Ranch Hand

Joined: Jul 02, 2003
Posts: 226
Why Sun took such a design decision for Objcet class as a Base class.

What is the speciail about the Objcet and why all classeses implemtes Object by default

Thanks,
Santosh
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
1. There are some methods common to all objects, like toString:

How could you have written such code without Object?

2. The Collection Framework (java.util.List, Set, Map, etc...)
rely heavily on Object to allow the defintion of general collections:

The current version of Java (1.5) compilcates this point with generics,
but the argument can still be made: Having a common base class is
very useful. C++, as you may know, lacks this, and most C++ Frameworks
begin by defining base classes that most their classes derive from,
directly or indirectly...


There is no emoticon for what I am feeling!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why Objcet is the Base class?
 
Similar Threads
super inside a base class constructor
Method call as an object reference
Aggregation And Inheritence
<jsp:UseBean> can also CREATE a bean! Or can it?
compare: are two objects from the same class