java 类型判断
//java 类型匹配测试
Circle circle = new Circle();
// circle rectangle 实现了 shape
System.out.println(circle instanceof Circle);//true 关键字
System.out.println(circle instanceof Shape); //true 对象和类比骄傲
System.out.println(circle instanceof Rectangle); //类型不匹配 编译报错
System.out.println(Shape.class.isAssignableFrom(Rectangle.class));//true 类和类比较
System.out.println(Shape.class.isInstance(circle));//true 类和对象比较
malu