I have an array that holds the ranks of playing cards: A, 2, 3, 4, 5, 6, 7, 8, 9, T, J, Q, K. (The "T" represents the 10).
I have all of these stored in an ArrayList.
For example, I have an ArrayList that represents the clubs and has all of the card ranks in it:
ArrayList<Character> clubs = new ArrayList<Character>();
If I print all of the elements in this ArrayList, they print out in the following order:
3 2 4 5 6 8 7 9 T J Q K A
I then added this to sort the collection:
Collections.sort(clubs);
With the collection sort, it prints the elements in this order:
2 3 4 5 6 7 8 9 A J K Q T
How can I make it so that it prints in this order: ?
A 2 3 4 5 6 7 8 9 T J Q K