This was the only part that was incorrect (the bolded line in the code I reposted). The line was getting the String form of a card, adding a newline, and assigning this new String to fullDeck, overwriting whatever fullDeck pointed to at the time. All that was needed was to append it to fullDeck.The += operator means "add/append and assign." For example "x += 2" adds 2 to x and is equivalent to "x = x + 2".Originally posted by russell lloyd:
The Deck toString() method is supposed to convert all the indices of yourDeck[] into strings concatenate them together and then print out the results.
Don't get me started about those stupid light bulbs. |