Skip to content

Commit 870e364

Browse files
committed
#0925 commit
1 parent ab582d4 commit 870e364

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

src/com/blankj/study/temp/Test13.java

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package com.blankj.study.temp;
2+
3+
import java.util.Arrays;
4+
import java.util.List;
5+
import java.util.stream.Collectors;
6+
7+
8+
public class Test13 {
9+
public static void main(String[] args) {
10+
int[] arr = {1, 2, 3};
11+
List list = Arrays.asList(arr);
12+
//System.out.println(list);
13+
//正确方式
14+
List arrlist = Arrays.stream(arr).boxed().collect(Collectors.toList());
15+
System.out.println(arrlist);
16+
17+
18+
String[] a = {"我", "是", "龙"};
19+
List list1 = Arrays.asList(a);
20+
System.out.println(list1);
21+
a[1] = "不是";
22+
list1.set(2, "虫");
23+
System.out.println(Arrays.toString(a));
24+
System.out.println(list1.toString());
25+
26+
//list1.add("新增");
27+
//list1.remove("我");
28+
System.out.println(list1);
29+
30+
31+
}
32+
}

0 commit comments

Comments
 (0)