开发者

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

This question already has answers here: How to most elegantly iterate through parallel collections? (8 answers) 开发者_JS百科 Closed 5 years ago.

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.


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.)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜