我从别人那里得到了一个引用,是object类型的,想通过某种方法查看这个引用具体是哪种类型的,请问使用什么方法?

解决方案 »

  1.   

    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.
      

  2.   

    其实吧,是这样,我这个object是在一个mapping的Value里的,刚才试了一下,还是不能具体的得到是什么类(我使用的是在方法里的内部类)