Also posted at Reading in a text file, constructing and adding it to an ArrayList
Type: Posts; User: Norm
Also posted at Reading in a text file, constructing and adding it to an ArrayList
The code tries to use an index value that is past the end of the array. The array has less than two elements.
Remember that array indexes range in value from 0 to the array length-1
Find the array...
What data is in the file being read? Where does the String: "ignore" come from?
Can the code detect the line with the invalid numeric data and skip it to prevent the exception?