• Post Reply Bookmark Topic Watch Topic
  • New Topic

Why object class???  RSS feed

 
Prakhar Jain
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is object class inherited implicitly or explicitly by all the java classes?? wht is the use of the functionality which it provides by the methods like notify(), equals() etc??
 
David McCombs
Ranch Hand
Posts: 212
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This will explain what each method does:

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html

Basically it is a convenience class. This helps to ensure that every object has at least some basic and consistent functionality. Some are generally not that useful unless overridden, equals() and toString(). Others probably should not be overridden, like notify() and finalize.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also see The singly rooted hierarchy from Eckel's Thinking in Java.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!