标签:ceo java [] test == nbsp rgs col sys
public class Test { public static void main(String[] args) { //instanceof 父类子类 Father father1 = new Father(); System.out.println(father1 instanceof Father ); //ture System.out.println(father1 instanceof Son ); //false Father father2 = new Son(); System.out.println(father2 instanceof Father ); //ture System.out.println(father2 instanceof Son ); //ture Son son = new Son(); System.out.println(son instanceof Father ); //ture System.out.println(son instanceof Son ); //ture } }
标签:ceo java [] test == nbsp rgs col sys
原文地址:https://www.cnblogs.com/frankcui/p/10810663.html