O'Reilly logo

Advanced Topics in Java: Core Concepts in Data Structures by Noel Kalicharan

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

CHAPTER 7

image

Working with Files

In this chapter, we will explain the following:

  • The difference between text files and binary files
  • The difference between internal and external file names
  • How to write a program to compare two text files
  • The try . . . catch construct
  • How to perform input/output with binary files
  • How to work with a binary file of records
  • What are random access files
  • How to create and retrieve records from random access files
  • What are indexed files
  • How to update a random access file using an index

7.1 Input/Output in Java

Java has a comprehensive range of classes for performing input/output. We have used System.in and System.out

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