Kizspy | Question: 41
(Choose 1 answer)
You are working on an application that simulates a deck of playing cards. Explain how you would use Java
collections to represent the deck, ensuring that cards are efficiently shuffled, drawn, and replaced. Discuss the
choice of collection type and any considerations for card removal and addition.
A. Utilize an ArrayList<Card> for easy manipulation and shuffling.
B. Design a custom Deck class with a circular linked list for efficient cycling.
C. Use a HashSet<Card> for unique card storage.
D. Implement a TreeSet<Card> for sorted card ordering.
E. Choose a PriorityQueue<Card> for card prioritization based on rank.
F. Utilize a custom CardDeck class with an embedded array for control over addition and removal.