So i'm trying to do my Java homework and i'm stuck, and i'm hopping there are some budding java programmers here to point me in the right direction
what i'm trying to do is read in a text file using the FileReader.
the file is a coma seporated file, and each line has 5 values, so i read it in split it by the comma and store it in a multi-dimsonal array.
this is not the problem, as its the same as VBasic . the problem is knowing how big the file is (line wise).
at presant i am decering an array as follows
String flightArray = new String[5][30];
but if there is more then 30 lines the file i loose values as my loop loops till the end of the larger arrays length
so here my problem
in VBasic there is "Redim preserve" theat lets you resize your array mid program. is there anything like this in Java? or is there a line counter for files?
if not then my only other alternitive is to open the file twice once to count the lines and once to read the lines once thhe array hass been sized but thats messy.
thanks in advance