I am having trouble attempting to store each line in a text file into an array. So far, my program is only able to read the file. Here is what i have so far.
public class assignment1 {
public static void main(String[] args) {
System.out.println(System.getProperty("user.dir"));
File fileName = new File("competitors.txt");
try {
Scanner scnr = new Scanner(fileName);
} catch (Exception e) {
System.out.println(e);
}
}
}