I have an Public class Account that i want to implement with comparable and my question is the following:
how can I make that the account with the lowest balance is the "smallest" in my comparison?.
public class Account implements Comparable<Account>{
private double balance;
private String acctNum;
public Account(String number, double initBal){
balance = initBal;
acctNum = number;
}
public double getBalance(){
return balance;
}
.....
public int compareTo(Account other) {
????????
}