|
What does the close() method do with an input stream? A good answer might be:It says that the program no longer needs the file. |
Closing Input FilesClosing an input file is less important than closing an output file. When end-of-file is detected there is no more data. (There is no need to flush an input file). But close input files anyway. Doing so lets the operating system manage resources more effectively. Of course, to write to a file after reading it in, the file must first be closed and then opened for input (with a FileReader stream). A word processor program might do this, for example. |
QUESTION 6:Can a program simultaneously read from one file and write to another? Click Here after you have answered the question |