Working with Files

  • Iuliana Cosmina


One of the most important functions in software is information organizing and storage, with the goal of using it and sharing it. Information is written on paper and stored in organized cabinets in real life where it can be retrieved from. Software applications do something similar. Information is written in files, files are organized in directories and eventually when in even more complex structures named databases. Java provides classes to read information from files and databases and classes to write files and write information to databases. In Chapter   9 , a simple example using a Derby in-memory database was introduced to show you how heavy dependencies like databases can be mocked to allow unit testing. This chapter is not about using databases, because writing Java applications for databases requires extra software to be installed. Instead, the chapter focuses on reading and writing files, and the many ways it can be done.

Copyright information

© Iuliana Cosmina 2018

Authors and Affiliations

  • Iuliana Cosmina
    • 1
  1. 1.EdinburghUK

Personalised recommendations