Just one.
The program will not read any more data than it has been written to deal with. Of course, the program could be written to read more than one line of data.
Here is an example input file, created with Notepad.
The file is named input.txt
.
This is line one of the file. This is line two of the file. The last line of the file.
Here is what the above program does when input.txt
is redirected to it as input:
C:\users\default\JavaLessons>java Echo < input.txt Enter your input: You typed: This is line one of the file. C:\users\default\JavaLessons>