I want the user input to be a string added to my array list each time the user inputs a new string. I think I am on the right track but I'm not entirely sure because I can't output my array. Here is my code.
System.out.println("input your word list");
Scanner scanner = new Scanner(System.in);
String phrase;
//not sure if phrase =""; is necessary but eclipse suggested it at one point
phrase = "";
ArrayList<String[]> wordlist = new ArrayList<String[]>();
for(int i=0; i<phrase.length();i++){
phrase = scanner.nextLine();
wordlist.add(new String[] {phrase});
}
System.out.println(phrase);
System.out.println(Arrays.toString(wordlist));
forloop. It currently says "loop once for each character in the stringphrase". Is that what you expected? If not, what should it be? How would you then translate that into a loop condition?