7. Closing a File


Answer:

Closing a file asks the system to finish all activity with the file and to ensure that it is safely on the disk.

Closing a File

manillaFileThe file reaper.txt is an ordinary ASCII text file, with one byte per character. Character strings inside a running Java program are two bytes per character. A Writer stream translates between the internal format and the external, disk file format.

As mentioned in the previous chapter, the disk file uses UTF ("Unicode Transformation Format") which is identical to 8-bit ASCII format for the common characters of English. In the USA, text files are usually ASCII (and therefore also UTF).


Question 7:

Can a file be written while it is closed?