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.
I’ve got two List objects and I want to pair them up, just like
Share
Functional Java has
zip,zipWithandzipIndexthe way you would expect from Haskell or Scala. (Indeed, the authors are pretty much all Haskell programmers.)