Classes in Java maycan only [[Inheritance (computer science)|inherit]] from one class. A class maycan derivebe derived from any class that is not marked as <code>final</code>. Inheritance is declared using the <code>extends</code> keyword. A class maycan reference itself using the <code>this</code> keyword and its direct superclass using the <code>super</code> keyword.
<source lang=Java5>
Line 1,162:
</source>
If a class does not specify theits superclass, it implicitly inherits from <code>java.lang.Object</code> class. Thus all classes in Java are subclasses of <code>Object</code> class.