Class类型

Class类(在java.lang包中,Instances of the class Classrepresent classes and interfaces in a running Javaapplication):
在Java中,每个class都有一个相应的Class对象。也就是说,当我们编写一个类,编译完成后,在生成的.class文件中,就会产生一个Class对象,用于表示这个类的类型信息
 
public final Class<?> getClass ()
Added in API level 1

Returns the unique instance of Class that represents this object's class. Note that getClass() is a special case in that it actually returns Class<? extends Foo> where Foo is the erasure of the type of the expression getClass() was called upon.

As an example, the following code actually compiles, although one might think it shouldn't:

List l = new ArrayList(); 
   Class<? extends List> c = l.getClass();

Returns
  • this object's Class instance.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值