Expert
Given a variable myStream of type Stream<Integer>, the following code
Integer[] positive = stream.filter(i -> i >= 0).toArray(size -> new Integer[size]);
Integer[] negative = stream.filter(i -> i < 0).toArray(size -> new Integer[size]);
Author: LoïcStatus: PublishedQuestion passed 231 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!
Similar QuestionsMore questions about Java