This content has been marked as final. Show 2 replies
Assuming that the data of each line should be kept together, create a value object which represents the data of a single line, create one instance of that VO for each line (I would use BufferedReader instead which offers an useful readLine() method and use String#split() to split the data by comma) and collect them all in a Collection (e.g. ArrayList). Finally you can let the VO implement the Comparable interface or write a Comparator class and use Collections#sort() to sort that Collection of VO's.
Also see http://www.google.com/search?q=object+ordering+tutorial+site:sun.com