Java继承:方法覆盖和方法隐藏有什么区别?

Java inheritance: What is the difference between method overriding and method hiding?

根据documentation

An instance method in a subclass with the same signature (name, plus the number and the type of its parameters) and return type as an instance method in the superclass overrides the superclass's method.

如果是静态方法

If a subclass defines a static method with the same signature as a static method in the superclass, then the method in the subclass hides the one in the superclass.

因此,我已经测试了此处显示的代码示例并添加了更多用例:
超级classAnimal:

public class Animal {
    public static void testClassMethod() {
        System.out.println("The static method in Animal");
    }
    public void testInstanceMethod() {
        System.out.println("The instance method in Animal");
    }
}

子class Cat:

public class Cat extends Animal {
    public static void testClassMethod() {
        System.out.println("The static method in Cat");
    }
    public void testInstanceMethod() {
        System.out.println("The instance method in Cat");
    }

    public static void main(String[] args) {
        Cat myCat = new Cat();
        Animal myAnimal = myCat;
        Animal animal = new Animal();
        Animal.testClassMethod();
        Cat.testClassMethod();
        animal.testInstanceMethod();
        myAnimal.testInstanceMethod();
    }
}

这里的输出是:

The static method in Animal
The static method in Cat
The instance method in Animal
The instance method in Cat

因此,我仍然看不出 覆盖 superclass instance 方法与 sub[=41= 之间没有实际区别] 具有相同签名的实例方法并覆盖(隐藏)superclass static (class) 方法与 sub class 具有相同签名的静态方法。
我在这里错过了什么?

您可以在对象方法(非静态)中调用 super(),但不能在静态方法中调用 super,因为没有可调用的“super”对象。

隐藏它意味着你不能在子 class 的实现中调用 super.method()

例如

class Cat extends Animal {
    public static void testClassMethod() {
        super.testClassMethod(); //this is not possible
        System.out.println("The static method in Cat");
    }
    public void testInstanceMethod() {
        super.testInstanceMethod(); //this is fine
        System.out.println("The instance method in Cat");
    }

}