I have to create a program which requests the user to input file names (one per line). Since I don’t know how many file names the user might enter, I thought that the while loop would be suffice enough to store the file names within an array list. Each time the user enters a file name within the while loop, it stores it within the array list. But I am having trouble breaking out of the while loop when the user enters a blank line i.e double returns when they are done entering the file names.
Share
this will take a line of input from the user and print it back out until the user enters an empty line. you can change the printing to whatever logic you need.