We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents dfd259c + ff09370 commit eca45d8Copy full SHA for eca45d8
zh-cn/section1.md
@@ -18,15 +18,15 @@ boolean 只有两个值:true、false,可以使用 1 bit 来存储,但是
18
基本类型都有对应的包装类型,基本类型与其对应的包装类型之间的赋值使⽤⾃动装箱与拆箱完成。
19
20
```java
21
-Integer x = 2; // 装箱 调⽤用了了 Integer.valueOf(2)
22
-int y = x; // 拆箱 调⽤用了了 X.intValue()
+Integer x = 2; // 装箱 调⽤用了 Integer.valueOf(2)
+int y = x; // 拆箱 调⽤用了 X.intValue()
23
```
24
## 缓存池
25
26
new Integer(123) 与 Integer.valueOf(123) 的区别在于:
27
28
- new Integer(123) 每次都会新建⼀一个对象;
29
-- Integer.valueOf(123) 会使⽤用缓存池中的对象,多次调⽤用会取得同⼀一个对象的引用。
+- Integer.valueOf(123) 会使用缓存池中的对象,多次调⽤用会取得同⼀一个对象的引用。
30
31
32
Integer x = new Integer(123);
0 commit comments