In this activity, we write a date-stamp to a text file.
In addition to the Solution document, the project for this activity contains three classes:
In addition, the project folder contains a text file, sample2.txt, empty at present, which is to be date-stamped.
At present the run method in DateStamper merely obtains a date-stamp and prints an informative message via System.out. Nothing is actually written to the file as yet. Your task is to supply the code that opens an output stream for writing to the text file, and writes the date-stamp to the file.
Open the file sample2.txt, using the File|Open File... option from the IDE. It should be empty. Leave the file open.
Open DateStamper and insert code where indicated. Run the project.
If your code is correct, you should see that sample2.txt has now acquired a date-stamp.