Java IO Problem
I have a problem about the text file to store into array.
I have a text file. It store three columns, Artist, Album and Tracks.
I need to store these data data into array and perform the sorting..
How can I store the text file into array?
Artist Album Tracks
Peter Peter Album 13
John John Album 14
Mary Mary Album 13
And then, How can perform the sorting after store into array?
Create an object with those three things as fileds, read the file line for line with a BufferedReader and populate these objects adding them to a list. Make sure the class implements Comparable and has a compareTo method, then sort the list using the Collections class and call toArray on the list (or call toArray on the List and sort the array using the Arrays class)..