If I got an array like this:
String[] items = { "Cat", "Frog", "Dog", "Ferret"};
For example, all 3-item combinations in this case would be (if I didn't miss any):
String[][] combinations = { 
{ "Cat", "Frog", "Dog" }, 
{ "Cat", "Dog", "Ferret" },
{ "Cat", "Frog", "Ferret" }, 
{ "Frog", "Dog", "Ferret" } };
How can I get all possible x-item combinations of a variable amount of items using a java method?
 
    