Any way to get the set of all pairs of pairs in Java?
Let's say I have a set with the following values: A, B, C, D. Is there an easy way to get a set containing AB, AC, AD, BC, BD, CD?
In Ruby, I can do this directly with the combination function . Any suggestions on how to do this in Java?
+2
Brad beattie
source
to share
1 answer
It is not built into the language or standard libraries, so you will need to link something like this in this example .
+2
Jim ferrans
source
to share