instanceof运算符 作用 作用 instanceof运算符左边是一个对象,instanceof运算符右边是一个类 判断instanceof左边的对象是否是右边类类型的对象 instanceof运算符的返回值是boolean类型 比如: Student stu=new Student(); System.out.println(stu instanceof Student);//返回值为true