aspose file tools
The moose likes Beginning Java and the fly likes Object extends Object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Barcodes with iOS this week in the iOS forum
or Core Java for the Impatient in the Java 8 forum!

JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Object extends Object" Watch "Object extends Object" New topic

Object extends Object

mohan rajv
Ranch Hand

Joined: Jan 28, 2009
Posts: 30
In java all classes extends Object class implicitly..
Object also a class in java
then is that also extends Object??!!
I am confused with this.can anyone explain with this problem?
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42954
The javadocs of a class -java.lang.Object included- will tell you which class it extends, if any.
mohan rajv
Ranch Hand

Joined: Jan 28, 2009
Posts: 30
In that javadoc it extends nothing.
but my doubt is we are not specifying anywhere our class extends Object,implicitly it extends Object na?
like this Object class how works?
David Newton

Joined: Sep 29, 2008
Posts: 12617

From the Object JavaDocs:
Class Object is the root of the class hierarchy. Every class has Object as a superclass. All objects, including arrays, implement the methods of this class.
Joanne Neal

Joined: Aug 05, 2005
Posts: 3742
The Java Language Specification is always a good place to start when looking for answers to questions like these

Section 8.1.4
The extends clause must not appear in the definition of the class Object, because it is the primordial class and has no direct superclass.

I agree. Here's the link:
subject: Object extends Object