2
Y at-il un équivalent Java à matrice méthode de # produit Ruby, ou une façon de le faire:Trouver le produit d'un nombre variable de tableaux de chaînes en Java
groups = [
%w[hello goodbye],
%w[world everyone],
%w[here there]
]
combinations = groups.first.product(*groups.drop(1))
p combinations
# [
# ["hello", "world", "here"],
# ["hello", "world", "there"],
# ["hello", "everyone", "here"],
# ["hello", "everyone", "there"],
# ["goodbye", "world", "here"],
# ["goodbye", "world", "there"],
# ["goodbye", "everyone", "here"],
# etc.
Cette question est une version Java de celle-ci : Finding the product of a variable number of Ruby arrays
Brillant, merci. –