I'm trying to add this file into an arraylist which I will later compare to another arraylist. So far I have this but it is giving me a compiling error. It is saying that it cannot find the symbol .hasNext and . readLine.
ArrayList<String> america = new ArrayList<String>();
while((infile2.hasNext()))
{
america.add(infile2.nextLine());
}
Can someone help me figure out how to fix these errors?
infile2is probably something like aBufferedReaderwhen it should be aScanner