If you get an Object object, you can use if (obj instanceof String) to determine whether it is a String object. Int is a basic type and cannot be judged like this. You can only use its wrapper class Integer, and also use instanceof
.If there are two Object parameters, you can use if(obj1.getClass()==obj2.getClass()) to judge whether the types are the same, if you want to get the type name, you can use obj.getClass().getName() to Get the class name of the object