The Numbers are not on the same line, there are 1000 lines each with a number.
This is the code I have but I receive an error when I run it, it points to the int part of the array list and says unexpected type.
import java.util.ArrayList;
import java.io.*;
import java.util.Scanner;
public class Homework4
{
public static void main(String[] args) throws IOException
{
//Variables
int num;
int temp;
Scanner kb = new Scanner(new File("number.txt"));
ArrayList<int> list = new ArrayList<int>();
while (kb.hasNextLine())
{
list.add(kb.nextLine());
}
//Close File
inputFile.close();
}
}