• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Why Objcet is the Base class?

 
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
reply
    Bookmark Topic Watch Topic
  • New Topic