I\'m trying to make an ArrayList that takes in multiple names that the user enters, until the word done is inserted but I\'m not really sure how.
ArrayList
done
ArrayList names = new ArrayList(); String userInput; Scanner scanner = new Scanner(System.in); while (true) { userInput = scanner.next(); if (userInput.equals("done")) { break; } else { names.add(userInput); } } scanner.close();