package ch.claude_martin.playground;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
public class SomeClass {
public static void main(String[] args) {
int[] a = { 1, 2, 3, 4 };
List<Integer> list = toList(a);
System.out.println(list);
}
public static List<Integer> toList(int[] a) {
return Arrays.stream(a).mapToObj(Integer::valueOf).collect(Collectors.toList());
}
}
Comments
0 B
|👍
/👎