The file contains two strings on different lines then two ints on the same line which are all used in the constructor for an array based on a class in my program called Flight.
Scanner fileIn = null;
try
{
fileIn = new Scanner(new File("flights.txt"));
}catch(FileNotFoundException e) {
throw new IllegalArgumentException("File was not found");
}
int count = 0;
while(fileIn.hasNextLine())
{
fileIn.nextLine();
count += 1;
}
flights = new Flight[count/3];
count = 0;
while(fileIn.hasNextLine())
{
String name = fileIn.nextLine();
String des = fileIn.nextLine();
int h = fileIn.nextInt(); //the two ints that im taking in are on the same line seperated by a space
int m = fileIn.nextInt();
Time t = new Time(h, m);
flights[count] = new Flight(name,des,t); //I need the data to be saved into this array based on the Flight class
count++;
}