Ok, so are you confused about the Object class (Object (Java Platform SE 6)
For the sake of not confusing the differences between the Object class and an object, I will refer to the Object class by its library (java.lang.Object) and an object by just "object".
If the java.lang.Object class is confusing you, the java.lang.Object class is effectively the "god-class" of java. EVERY object in java extends java.lang.Object by default. By extending java.lang.Object, every object gains access to the java.lang.Object class's methods.
Now, in java, every time you make a class, you are making a new object. Every time you call a method, you are calling a method of an object.
For example, String is an object (String (Java Platform SE 6)
). Since String is an object, it extends java.lang.Object. The String class contains something like a hundred or so methods that are specified in its API. But apart from the methods specified in its API, it also has access to all of java.lang.Object's methods that String has not overwritten (when an object wants to use an inherited method differently than how it is already declared). So, String also has access to 8 of java.lang.Object's methods. Since String has inherited these methods instead of overwriting them, if you call one of java.lang.Object's method from a String, it will use java.lang.Object's declaration.
Inheritance can be difficult to understand. When an object (Object_A) extends another object (Object_B), Object_A is an Object_B, but a different version of Object_B with added functionality. But here's the catch, Object_B is not aware that Object_A is a "child" of it, but Object_A is aware that it is a "child" of Object_B.
So, have a look at this:
Component -> java.lang.Object
The above says that Component is an java.lang.Object. As you can see by the direction of the arrow, Component can see java.lang.Object, but java.lang.Object cannot see Component.
Button -> Component -> java.lang.Object
So, Button extends Component, so Button is a Component. But, Component extends java.lang.Object, which means that Component is an java.lang.Object. This means that Button is also
an java.lang.Object, since Component is an java.lang.Object and Button extends Component. Also, Button is aware that it is a Component. It is also aware that Component is an java.lang.Object, so it is aware that it is also an java.lang.Object. Component is aware that it is an java.lang.Object, but it is not aware that Button is a Component or an java.lang.Object. Basically, Component doesn't even know that Button exists and java.lang.Object doesn't even know that Component and Button exist.
Tell me how much sense all that makes. Read it slow and try your best to understand it. Inheritance is very important to Object-Oriented programming.