首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2SE开发 >

如何确定引用的类型?(确定一个Object引用具体是什么)

2012-01-13 
怎么确定引用的类型?(确定一个Object引用具体是什么)我从别人那里得到了一个引用,是object类型的,想通过某

怎么确定引用的类型?(确定一个Object引用具体是什么)
我从别人那里得到了一个引用,是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.

热点排行