Problem with sort method
Does anyone know how I would go about writing a method that sorts using this set up?
This is what I have so far, but it's complain that there's any error with the .sort.
public static void sort(ArrayList<Insurance> insure)
I think you want to use the Collections helper class. It has static methods to help you sort things like ArrayList's. However, you will need to make sure that the Insurance class implements Comparable which means that it has to have a compareTo() method. Take a look at the docs - it's really not too bad.
I have this for my compareTo() and when I run the Collections.sort(insure) it just skips over the comand?
public int compareTo(Object obj)
Insurance insure = (Insurance) obj;
if (insure.getCustomer().getCustID() < this.getCustomer
else if (insure.getCustomer().getCustID() > this.getCustomer