int.class和Integer.class有何不同?
来源:互联网 发布:网络审核员天河 编辑:程序博客网 时间:2024/06/05 18:45
public class Test {
/**
* @param args
*/
public static void main(String[] args) {
/**
* 基本的 Java 类型(boolean、byte、char、short、int、long、float 和 double)
* 和关键字 void 也表示为 Class 对象。
*
* 代表Class类的不同实例(个人感觉)
*/
Class c = int.class;
Class c0 = Integer.class;
System.out.println(c+" : "+c0);
System.out.println(c.getName()+" : "+c0.getName());
/**
* 输出:
* int : class java.lang.Integer
* int : java.lang.Integer
*/
}
}
/**
* @param args
*/
public static void main(String[] args) {
/**
* 基本的 Java 类型(boolean、byte、char、short、int、long、float 和 double)
* 和关键字 void 也表示为 Class 对象。
*
* 代表Class类的不同实例(个人感觉)
*/
Class c = int.class;
Class c0 = Integer.class;
System.out.println(c+" : "+c0);
System.out.println(c.getName()+" : "+c0.getName());
/**
* 输出:
* int : class java.lang.Integer
* int : java.lang.Integer
*/
}
}
阅读全文
1 0
- int.class和Integer.class有何不同?
- int.class和Integer.class
- interface和abstract class有何不同? (C/C++) (.NET) (C#)
- int.Class和integer.class不是一回事
- int.class 和Integer.class不是相同的class对象
- 请问NSInteger与int有何不同
- 当我们在使用CSS的时候ID与Class有何不同?
- 任务、进程和线程有何不同
- encodeURI和encodeURIComponent有何不同?
- 工作流和BPM有何不同?
- 绘画和平面设计有何不同
- getColumnIndex() 和 getColumnIndexOrThrow() 有何不同?
- strcpy和memcpy有何不同
- [iOS] stringWithFormat 和 initWithFormat 有何不同?
- input和raw_input有何不同?
- iOS stringWithFormat 和 initWithFormat 有何不同?
- [iOS] stringWithFormat 和 initWithFormat 有何不同?
- Caffe2和Caffe有何不同?
- Nginx Learing
- 面向对象程序设计(Object-oriented programming,OOP)
- React native与phoneGap jquery mobile
- Andrew Ng笔记-week2
- kuangbin KMP G题
- int.class和Integer.class有何不同?
- 尝试Adam代替梯度下降
- OpenStack通过Restful api获取token
- 期货多品种多策略多周期组合
- oracle create tablespaces and create user ---cxl
- jenkins 从svn下载源码中途断网问题
- Retrofit请求参数注解字段说明
- 最火房卡欣欣十三水房卡棋牌源码下载
- DAGScheduler核心步骤解读