Character Set Transformation

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.
go to previous page   go to home page   go to next page        

Answer:

Sure. It is a text file.

Character Set Transformation

The 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.

characters stream going to disk

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 6:

What do you suppose closing a file does?