I am trying to run a basic scan of a large file, however it keeps giving me a FileNotFound exception however the file is in the same folder as the classes.(Using a mac currently)
import java.io.*;
import java.util.Scanner;
public class LastNameSearch {
static PopularName[] people= new PopularName[151671];
public static void main(String[] args){
String nextString=null;
PopularName nextName;
String[] info=new String[5];
Scanner infile = new Scanner(new FileReader("LastNames.txt"));
int index=0;
while(infile.hasNext()){
nextString=infile.nextLine();
info=nextString.split(",");
nextName=new PopularName(info[0], info[1], info[2], info[3], info[4]);
people[index]=nextName;
}
infile.close();
new FileReader("LastNames.txt") This line is what is causing me pain. Please Help.