Hello I wrote a java program that prompts for user input (through terminal, nothing sophisticated)
I wanted to run the program but instead of typing the input, I wanted to use a txt file. I'm sure there is a way to do this but cant find it, anyone know how to do it
heres an example the program ask for a list of 20 numbers, so I saved a list of numbers in a text file (same dir as program) and want it to read from the file. it's just to speed up testing, I'm not looking to actually open the text file using my code or anything, i just want it to use the text file as though I were actually typing it in terminal
I wanted to run the program but instead of typing the input, I wanted to use a txt file. I'm sure there is a way to do this but cant find it, anyone know how to do it
heres an example the program ask for a list of 20 numbers, so I saved a list of numbers in a text file (same dir as program) and want it to read from the file. it's just to speed up testing, I'm not looking to actually open the text file using my code or anything, i just want it to use the text file as though I were actually typing it in terminal