I am stuck on how to organize 5 cards from highest to lowest. the 5 cards will come into the method as an array called handDeck, the array would look something like this: {"Ace spades", "Five hearts",...etc}. What I tried is iterate through the array and splitting each element into smaller array contain the first and second word for example: in the example array I wrote earlier, the first sub-array would look like this: {"Ace", "Spades"}. this can allow me to check every first element of those 5 sub-arrays and check which order they should follow. however, I don't know how to implement this sub-array method. i haven't coded in so long so my memory is very shady right now. also if you can give me a hint on how to check the order of the first element of the sub-arrays, that would be very helpful.
the code that I tried is this:
String[] deck = {"Ace spades", "Five hearts", "Four spades", "King diamonds", "Queen diamonds"};
for(int i = 0; i < 5; i++) {
String s = deck[i];
s.split(" ");
System.out.println(s);
}