I am looking for a way to sort an arraylist. I am not sure exactly how to set this up, as I am pretty new to
Java. I want to add one line of data elements to an arraylist something like this:
Arraylist a1 = new ArrayList;
ArrayList a2 = new ArrayList;
a1.fname = "joe";
a1.lname = "schmoe";
a1.address = "9999 broadway";
a1.phone = "999-999-9999";
a2.add(a1);
Should a1 really be an ArrayList? or something else?
I then want to be able to pass in a param like (lname, asc) to sort last name ascending. How do I set a1 up so that it has columns. I saw something similar to this done in the DictionaryEntry class, I just want to expand it to include more columns. Any help out there?