created a program to receive input from user and store the input in a java collection but i don’t seem to find any method that does that either in BufferedReader() or Scanner().
i want the program to receive an input from the user and run it through the data in an set, or ArrayList, or map
posted 10 months ago
Neither buffered readers nor scanners have methods to put elements into collections/maps. You can run a loop in which you add objects to your List, or you can use the lines() method to create a Stream<String>.