I've read these two stack overflow posts: this one and this one. I've followed the answers and am still getting no where.
I'm trying to read in a text file (this one) and store it in an ArrayList. But when i go ahead and print the contents of the ArrayList to the console, nothing is returned...
Any help would be appreciated.
public static void main(String[] args) throws IOException {
ArrayList<Integer> test = new ArrayList<Integer>();
Scanner textFileOne = new Scanner(new File("ChelseaVector.txt"));
while (textFileOne.hasNext()) {
if(textFileOne.hasNextInt()) {
test.add(textFileOne.nextInt());
} else {
textFileOne.next();
}
}
textFileOne.close();
System.out.println(test);
}