CHAPTER 22 — Reading Data from a File

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 home page   go to next page        

Created: 01/14/99; revisions: 08/13/99, 01/20/00, 07/13/02, 01/15/06

CHAPTER 22 — Reading Data from a File

The previous chapter discussed text files and text file output. This chapter discusses reading from text files.

Chapter Topics:

  • Input file redirection
  • Problems with blank lines
  • Redirecting both input and output
  • Numeric input from a text file
  • Problems with illegal characters in a number
  • The trim() method

QUESTION 1:

Where has the data for our previous programs come from?