stream().findAny()
时间: 2023-09-03 07:06:36 浏览: 86
stream().findAny()方法的作用是从Stream中获取任意一个元素。正常情况下,它会返回第一个元素。而在并行流的情况下,它会随机返回一个元素。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [Stream.findAny](https://blog.csdn.net/zhuweifeng/article/details/118083259)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *3* [熟练使用stream操作集合,能通过例题举一反三,合理地将案例融入到实际工作中。](https://download.csdn.net/download/qq_39706570/85273864)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文