inheritance in Java

In Java, all classes inherit from the Object class directly or indirectly. Therefore, there is always a single inheritance tree of classes in Java, and the Object Class is the root of the tree. In Java, when creating a class it automatically inherits from the Object Class. 
```
class Test { }

class Main {
    public static void main(String[] args)
    {
        Test t = new Test();
        System.out.println("t is instanceof Object: "
                           + (t instanceof Object));
    }
}

/* output
t is instanceof Object: true
*/
```
When a class inherits two methods with the same signature from a superclass and a superinterface, the one from the superclass always takes precedence.