I am trying to figure out how to combine some of the lists so when you put in "BAD" or "Bad" it takes the B, A, and D and prints them out in one line of text.
import java.util.*;
public class Map4_for {
public static void main(String[] args) {
boolean repeat = (false);
while(!repeat){
Scanner in = new Scanner(System.in);
String name = in.next();
List <String> listClone = new ArrayList<String>();
if(name.startsWith("A")|| name.equalsIgnoreCase("A")){
listClone.add("Alpha");
System.out.println(listClone);
}
else if(name.startsWith("B")|| name.equalsIgnoreCase("B")){
listClone.add("Bravo");
System.out.println(listClone);
}
else if(name.startsWith("C")|| name.equalsIgnoreCase("C")){
listClone.add("Charlie");
System.out.println(listClone);
}
else if(name.startsWith("D")|| name.equalsIgnoreCase("D")){
listClone.add("Delta");
System.out.println(listClone);
}
else if(name.startsWith("E")|| name.equalsIgnoreCase("E")){
listClone.add("Echo");
System.out.println(listClone);
}
else if(name.startsWith("F")|| name.equalsIgnoreCase("F")){
listClone.add("Foxtrot");
System.out.println(listClone);
}
}
}
}