I have an string array
{\"ted\", \"williams\", \"golden\", \"voice\", \"radio\"}
and I want all possible combinations of these keywords in
package rnd;
import java.util.ArrayList;
public class Rnd {
public static void main(String args[]) {
String a[] = {"ted", "williams", "golden", "voice", "radio"};
ArrayList result =new ArrayList<>();
for(int i =0 ;i< a.length; i++){
String s = "";
for(int j =i ; j < a.length; j++){
s += a[j] + " " ;
result.add(s);
}
}
}
}