集合与数组互转

2018-08-10 18:13:09

1、Collection转化为int[],可以使用

collection.stream().mapToInt(i -> i).toArray()

2、int[]转为集合,可以使用

Arrays.stream(A).boxed().collect(Collectors.toList())

  

posted @ 2018-08-10 18:14  hyserendipity  阅读(189)  评论(0编辑  收藏  举报