Does it create an output class instance to write to a disk file before trying to read from that file? Creating the instance of the output class can create an empty file.
any way I can fix this?
file seems to get overwritten(or everything wiped) once the program executes
Dave Tolls wrote:Well, your numberWriter is opened to append, so that's what it's going to do.
Knute Snortum wrote:It is often the case that refactoring your code leads to problems going away -- at least they become easier to spot.
Mark my words: don't create Scanner objects in your class. Create a utility class which has one Scanner field and use that scanner exclusively.
Adam Chalkley wrote:. . . Mike Smith the first part of the string in this case Mark is cut off and only Smith . . .
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your databasehttps://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database