Question
Write a class whose instances represent a single playing card from a deck of cards. Playing cards have two distinguishing properties: rank and suit. Use
Write a class whose instances represent a single playing card from a deck of cards. Playing cards have two distinguishing properties: rank and suit. Use an enum type to represent rank and another enum type to represent suit. Write another class whose instances represent a full deck of cards. Both these classes should have toString methods. Write a small program to test your deck and card classes. The program can be as simple as creating a deck of cards and displaying its cards by calling its toString method.
(You might need to create the following files: Suit.java for enum type, Rank.java for enum type, Card.java, Deck.java and DeckDemo.java)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started