public int compareTo(Object o) { Card other = (Card)o; if( !suit.equals(other.suit) ){ // if the suits aren't the same, just use the // Strings compareTo method to rank alphabetically return suit.compareTo(other.suit); }else{ // Same suit, so rank by number if( number < other.number ){ return -1; }else if( number > other.number ){ return 1; }else{ return 0; } } } ------ Extra Challenge ------- public int compareTo(Object o) { Card other = (Card)o; if( !suit.equals(other.suit) ){ // if the suits aren't the same, just use the // Strings compareTo method to rank alphabetically return suit.compareTo(other.suit); }else{ // Same suit, so rank by number if( number == 1 ){ if( other.number == 1 ){ return 0; }else{ // ace is bigger than everything return 1; } }else if( other.number == 1 ){ // number cannot be 1 return -1; }else{ // neither are aces, so just the normal comparison if( number < other.number ){ return -1; }else if( number > other.number ){ return 1; }else{ return 0; } } } } // NOTE: another option would be to re-encode the numbers for this class so that ace was the highest number