The Integer class wraps a value of the primitive type int in an object. An object of type Integer contains a single field whose type is int.
简单说是一个聚合关系,我也是查资料的.- package java.lang;
-
- public final class Integer extends Number implements Comparable<Integer> {
-
- private final int value;
-
- public Integer(int value) {
- this.value = value;
- }
- }
复制代码 上边的是其实现的代码!
至于什么是后用Integer,举个例子:当你想用到integer类中的一些方法的时候,你就得用到它。 |