基本类型数组转List

基本类型数组转List

小数

double[] src = {1.1,2.1,3.1};
List<Double> list = Arrays.stream( src ).boxed().collect(Collectors.toList());
System.out.println(list);

字符串

String[] split = {"a","b","c"};
List<String> stringList = Arrays.asList(split);
System.out.println("stringList = " + stringList);

 

posted @ 2020-08-29 20:30  骚哥  阅读(490)  评论(0编辑  收藏  举报