我从别人那里得到了一个引用,是object类型的,想通过某种方法查看这个引用具体是哪种类型的,请问使用什么方法?
------解决方案--------------------
getClass()
------解决方案--------------------
Class<? extends String> java.lang.Object.getClass()
Returns the runtime class of an object. That Class object is the object that is locked by static synchronized methods of the represented class.
Returns:
The java.lang.Class object that represents the runtime class of the object. The result is of type Class where X is the erasure of the static type of the expression on which getClass is called.