auto commit
This commit is contained in:
@ -63,8 +63,8 @@ boolean 只有两个值:true、false,可以使用 1 bit 来存储,但是
|
||||
基本类型都有对应的包装类型,基本类型与其对应的包装类型之间的赋值使用自动装箱与拆箱完成。
|
||||
|
||||
```java
|
||||
Integer x = 2; // 装箱
|
||||
int y = x; // 拆箱
|
||||
Integer x = 2; // 装箱 调用了 Integer.valueOf(2)
|
||||
int y = x; // 拆箱 调用了 Integer.intValue(x)
|
||||
```
|
||||
|
||||
## 缓存池
|
||||
@ -154,7 +154,7 @@ System.out.println(m == n); // true
|
||||
|
||||
## 概览
|
||||
|
||||
String 被声明为 final,因此它不可被继承。
|
||||
String 被声明为 final,因此它不可被继承。(Integer 等包装类也不能被继承)
|
||||
|
||||
在 Java 8 中,String 内部使用 char 数组存储数据。
|
||||
|
||||
|
Reference in New Issue
Block a user