How to code Stream.findNth()?(如何编码 Stream.findNth()?)
问题描述
类似于Stream.findFirst()
,有没有办法写Stream.findNth()
?
Similar to Stream.findFirst()
, is there a way to write Stream.findNth()
?
我正在通过重写一些遗留代码来练习 Java 8.而且,我想知道如何使用 Stream API 编写以下函数.
I'm practicing Java 8 by rewriting some legacy code. And, I'm wondering how the below function can be written using Stream API.
我希望它会转化为:
推荐答案
这篇关于如何编码 Stream.findNth()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!