(a) This class should contain an ArrayList (whose capacity can be initialized to
ID: 3640577 • Letter: #
Question
(a) This class should contain an ArrayList (whose capacity can be initialized to 52).(b) The constructor for this class should ?ll the ArrayList with 52 Card objects
(c) A Deck should also contain a draw() method, which returns the next card in the deck. For simplicity, you may want to simply remove the ?rst Card from the ArrayList, and return it as the drawn card. This means that the size of the ArrayList will shrink as you draw more cards, and you will need to recreate the deck before you use it again.
(d) Deck class should also include a shuffle() method. This method should change the order of the Cards in your ArrayList. The simplest way to do this is to remove randomly-selected cards from the deck, one at a time, and replace them at the end of the deck. For example, you might remove the fourth card in the deck and place it in the last position. By repeating this a number of times, you can be assured that the deck will be somewhat randomized. To generate random integers, use the Random class in the java.util package; see the slides for examples of how to use Random.
(e) Deck class should also include a toString() method that returns a String containing the current contents of the deck, in order