Is there an accepted Java equivalent to Python's zip()? [duplicate]

*爱你&永不变心* 提交于 2019-12-17 06:14:07

问题


I've got two List objects and I want to pair them up, just like the zip() function in Python. I'm pretty sure this isn't available in the JDK, but is there something like this in a fairly widespread library, similar to Apache Commons Collections? Thanks.


回答1:


Functional Java has zip, zipWith and zipIndex the way you would expect from Haskell or Scala. (Indeed, the authors are pretty much all Haskell programmers.)



来源:https://stackoverflow.com/questions/2118932/is-there-an-accepted-java-equivalent-to-pythons-zip

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!