gpt4 book ai didi

java - 是否存在与 Python 的 zip() 等效的公认 Java?

转载 作者:IT老高 更新时间:2023-10-28 20:35:28 26 4
gpt4 key购买 nike

我有两个 List 对象,我想将它们配对,就像 zip() 一样Python 中的函数。我很确定这在 JDK 中不可用,但是在相当广泛的库中是否有类似的东西,类似于 Apache Commons Collections ?谢谢。

最佳答案

Functional Javazip , zipWithzipIndex 就像你对 Haskell 或 Scala 所期望的那样。 (事实上​​,作者几乎都是 Haskell 程序员。)

关于java - 是否存在与 Python 的 zip() 等效的公认 Java?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2118932/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com