I need some help how to sort an ArrayList of objects. I have the superclass Account and two subclasses SavingsAccount and CreditAccount. Inside the Account class I have this met
java.util.Collections.sort(list) - use it when Account implements Comparable.
java.util.Collections.sort(list, new Comparator(){
public int compare(Account a, Account b){
return a.getAccountNumber().compareTo(b.getAccountNumber()
}
});