A collector that returns an array
2 answers
The class Stream
has two methods toArray
- here's an example with Stream :: toArray (IntFunction) ` :
String[] array = strings.stream().toArray(String[]::new);
+6
source to share