Didn’t Java once have a Pair class? [duplicate]

There is no Pair in the standard framework, but the Apache Commons Lang, which comes quite close to “standard”, has a Pair.

new MutablePair<>(1, "xxx");
new ImmutablePair<>(1, "xxx");

Leave a Comment