Hi,
When a user inputs data via a keyboard in the
test main class, and subsequently saves this data to a text file, an extra space is added before the
string data. The text file is saved in the following format,
Each subsequent addition and saving of data to the file, adds a further space before the string in the text file. Therefore, each time some data is added and saved to the text file, another space is also saved. I really don't see why this happening.
The code for the constructors in the video class is as follows
The method for saving the data to the text file is as follows,
The strange thing, is that when the data is saved to the text file, the addition of an extra space before the string does not affect the first and last line of the text file.
This is all rather puzzling at the moment. Any ideas or advice as to why this might be happening?