February 2014
Beginner
1248 pages
62h 25m
English
Data is stored in files so that it may be retrieved for processing when needed. Section 15.4.1 demonstrated how to create a file for sequential access. This section shows how to read data sequentially from a text file. We demonstrate how class Scanner can be used to input data from a file rather than the keyboard. The application (Fig. 15.6) reads records from the file "clients.txt" created by the application of Section 15.4.1 and displays the record contents. Line 13 declares a Scanner that will be used to retrieve input from the file.
Read now
Unlock full access