java中判断对象是否是类的实例有3个关键字:instanceof、isInStance、isAssignableFrom
1、instanceof :实例对象 instanceof 类
String s = new String("hello girl");
Boolean b = s instanceof String; //true
2、isInstance:类.class.isInstance(实例对象)
String s = new String("hello girl);
Boolean b = String.class.isInstance(s); //true
3、isAssignableFrom:类.class.isAssignableFrom(类.class)
ArrayList.class.isAssignableFrom(Object.class); //false
Object.class.isAssignableFrom(ArrayList.class); //true