instanceof 判断x和y之间是否存在父子关系 Systen.out.println(x instanceof y); 类型转换 Person obj=new Student(); Student student=(Student)obj; ((Student) obj).go(); //go为子类student的方法 子类转换为父类,向上转型,不用强制转换,可能丢失自己的一些方法父类转换成子类,向下转换,强制转换