Do a reduction that simply returns the current value:Stream<T> stream;
T last = stream.reduce((a, b) -> b).orElse(null);
Do a reduction that simply returns the current value:Stream<T> stream;
T last = stream.reduce((a, b) -> b).orElse(null);
该资源仅限VIP专享下载