请您告诉我 peek 操作符不显示 system.out.print 的原因吗?
代码:
public static void main(String[] args) {
//try stream.of
List<Integer> numbers = Arrays.asList(0,1,2,3,4,5,6,7,8);
Stream<Integer> p = numbers
.stream()
.filter(x -> x >= 5)
.peek(x-> System.out.print("peek at: " + x));
System.out.print("peek at: ");
}
皈依舞
青春有我
慕哥6287543
相关分类