Introduction
The objectives of this lab are to:
- Review the basics of reading and writing text files from Java.
- Apply your
Scanner
knowledge to parse a text file. - Read the data from a text file into an
ArrayList
of objects.
Your first step is to create a new project in your workspace, named
project6
. Inside that project, create a package lab6
.
The working directory in Eclipse
Since we will be working with files, we'll need to know where they are. Before
you begin, use Windows File Explorer (or OS X Finder) to find the directory for your Eclipse workspace and look inside it. You should see a directory for each project you've created, including
the directory project6
created above. When you run your code from Eclipse, it uses the project directory as the working directory.
Take a moment and download each of the sample files for this lab and
put them into the project directory project8
.