Writing and Reading Files

Jay Bryant · Apress eBooks · 2012

Writing data to and reading data from files are common tasks for almost any kind of program. Even simple games, such as our MineSweeper game, can benefit from storing information in a file and retrieving it later. (MineSweeper could store the size of game the player last chose and keep track of the best time for each size.) Java provides an extensive collection of classes and interfaces for dealing with files (and associated objects such as directories and drives). The heart of it all is the aptly named and often-used java.io.File class. “io” stands for input/output. These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Read the paper · More papers on PaperTik