This commit is contained in:
krahets
2023-02-09 19:44:54 +08:00
parent 4d2575be7a
commit 3dcf65c61b
2 changed files with 18 additions and 3 deletions

View File

@@ -86,7 +86,7 @@ comments: true
/* 初始化列表 */
// 无初始值
List<int> list1 = new ();
// 有初始值(注意数组的元素类型需为 int[] 的包装类 Integer[]
// 有初始值
int[] numbers = new int[] { 1, 3, 2, 5, 4 };
List<int> list = numbers.ToList();
```