Good, Veran I have this code
private static void Perm2(String[] elem, String act, int n, int r) {
if (n == 0) {
System.out.println(act);
} else {
for (int i = 0; i < r; i++) {
if (!act.contains(elem[i])) { // Controla que no haya repeticiones
Perm2(elem, act + elem[i] + ", ", n - 1, r);
}
}
}
}
and as you will realize it prints all the results in console, what I would like is to be able to save everything in a single String to be able to use that String at my convenience if possible or at least to print it in a JOptionpanel if it is possible clear.
Thank you in advance