O'Reilly logo

Introducing Data Structures with Java by David Cousins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

4

File Input and Output

Contents

  • Alternative program input/output
  • Data files
  • Text and binary files
  • Reading and writing to files
4.1 INTRODUCTION

In Chapter 3, we examined processes for reading input from a keyboard and displaying output on screen. Alternatively, a program’s data might come from backing storage and its output may be written there. Files—their types, access and processing—represent a very wide topic to which one cannot do full justice in a study of data structures. Java has a number of methods for reading from and writing to data files, and we will briefly examine some of them in this chapter in the context of program input and output. They will be used in case studies later in this book.

4.2 TEXT AND BINARY FILES

We distinguish ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required