Readers and Writers

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:

A Reader is an input stream.

Readers and Writers

Readers and Writers deal with character streams. These are abstract classes. A program must use classes derived from them. For example, a BufferedReader is a Reader.

Character streams are optimized for handling character data. They also translate between the internal format used by Java programs and an external format used for text files. Inside a Java program character data is represented with the 16-bit char data type. The characters of a String use the same 16-bit code. On a disk file, characters are represented in a format called UTF. This format uses one to four bytes per character and is intended to be a universal format—one format for all text files in any language anywhere in the world.

UTF stands for "Unicode Transformation Format". Usually a UTF text file is identical to an ASCII text file. ASCII is the standard way to represent characters that most computers have used for the past forty years. A file created with a text editor is usually an ASCII text file.

A UTF text file can include non-ASCII characters such as Cyrillic, Greek, and Asian characters. By reading and writing UTF files, Java programs can process text from any of the World's languages.

QUESTION 8:

Could a Java program use the alphabet used on the island of Java?