My program reads in text files of various sizes. It then takes the numbers from the text file and creates array lists based on the numbers. The largest file i plan on using is 286,040 KB. When I run my program and it reads the file, my program stops working.
How do I know what size is the maximum my java program can handle? Is there a way of computing how big a size a file my java program can handle?
Also, what are the best suggestions for making my program be able to hold array lists of such a large size? I have heard of hash tables, however; I have not been able to full understand the concept.
Per Request, I'm adding how I upload the file:
String name = getFileName();
Scanner scanDaily = new Scanner(new File(name));
public static String getFileName()
{ //getFileName
Scanner getName = new Scanner (System.in);
System.out.println("Please input File Name");
String fileName = getName.nextLine();
return fileName;
} //getFileName
Update : Thank you to those who responded, its been very helpful
New problem
I now want to read the numbers from the file into an arraylist
String name = getFileName();
FileReader f= new FileReader(new File(name));
BufferedReader bf=new BufferedReader(f);
Scanner sc=new Scanner(bf);
ArrayList<Double> ID = new ArrayList<Double>();
ArrayList<Double> Contract = new ArrayList<Double>();
ArrayList<Double> Date = new ArrayList<Double>();
ArrayList<Double> Open = new ArrayList<Double>();
ArrayList<Double> High = new ArrayList<Double>();
ArrayList<Double> Low = new ArrayList<Double>();
ArrayList<Double> Close = new ArrayList<Double>();
ArrayList<Double> Volume = new ArrayList<Double>();
int rows = 8;
int counter1 = 0;
//Update code to prompt user for file
ArrayList<Double> list = new ArrayList<Double>();
while (scanDaily.hasNext())
{ //while
double value = scanDaily.nextDouble();
DecimalFormat df = new DecimalFormat("#.#####");
df.format(value);
list.add(value);
} //while
before I used a scanner to read my file, and that scanner was named scandaily. Now that I have a filereader and a buffered reader, which one do i use to go through my txt file?