Hello I am trying to sort a list of numbers on seperate files from a text document in C:/Scores.txt. First off in processFile I am trying to return the numbers located in the file as an array. I am having some issues understanding what i should change into an array for it to return all the numbers as an array. Also it would bea bonus to know how to read each line one by one.
package readandsort; /** * * @author Logan */ import java.io.*; public class ReadAndSort { public static void main(String[] args) { } public static int processFile (String scores) throws IOException, FileNotFoundException { FileInputStream fstream = new FileInputStream("c:/scores.txt"); DataInputStream in = new DataInputStream(fstream); BufferedReader br = new BufferedReader(new InputStreamReader(in)); String strLine; double doubleValue; while ((strLine = br.readLine()) !=null) { doubleValue = Integer.parseInt(strLine); return doubleValue; } br.close(); } } } }