Java IS-A 关系 Java 调用父类构造方法 Java instanceof 关键字 Java IS-A 关系 class Animal { } class Mammal extends Animal { } class Reptile extends Animal { } public class Dog extends Mammal { public static void main(String args[]) { Animal a = new Animal(); Mammal m = new Mammal(); Dog d = new Dog(); System.out.println(m instanceof Animal); System.out.println(d instanceof Mammal); System.out.println(d instanceof Animal); } } Java 调用父类构造方法 Java instanceof 关键字