Java中的int.class和Integer.TYPE有什么区别? [英] What is difference between int.class and Integer.TYPE in java?

查看:65
本文介绍了Java中的int.class和Integer.TYPE有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道Java中int.class和Integer.TYPE之间的区别吗?

I want to know the difference between int.class and Integer.TYPE in Java?

推荐答案

.class 关键字获得Class 对象代表原始类型和类类型,而该对象所包装的原始类型的Class .

The .class keyword get the Class object represent both primitive types and class types, while the .TYPE field of the wrapper primitive class allows you to get the Class of the primitive type which that object wraps.

这篇关于Java中的int.class和Integer.TYPE有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆