Skip to content

Commit 31c661b

Browse files
authored
Create 04_Array_Creation.md
1 parent 8dc7e96 commit 31c661b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ch06/04_Array_Creation.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## 数组创建
2+
3+
数组通过它们的组件类型来进行通用化,这意味着它们携带有关组件类型的运行时信息。 此实体类型信息用于实例测试和强制转换,还用于检查是否允许分配到数组组件。
4+
回想一下第 `2.5` 节中的这个例子。
5+
6+
```java
7+
Integer[] ints = new Integer[] {1,2,3};
8+
Number[] nums = ints;
9+
nums[2] = 3.14; // 数组存储异常
10+
```

0 commit comments

Comments
 (0)