Use an if statement to test if the String is empty and don't use it if it is.
Type: Posts; User: Norm
Use an if statement to test if the String is empty and don't use it if it is.
Test the variable being passes to the parseDouble() method and make sure it is not an empty string:
If string is not empty
call parseDouble
else
don't call parseDouble
That error happens in the processFile() method at line 46 where it calls the parseDouble() method.
How many numbers does it read?
How many numbers are written to the file?
What happens to the first number that is read?
When do you expect the code to exit the while() loop?
What is the value...
How does the code execute now?
There are a couple of coding conventions you are not following:
You should always use {}s with loops to enclose the code that is in the loop. Same for if statements.
Nested statements within loops...
The condition for the while statement should be completely inside the ()s.
How can the code execute with compiler errors?