To get experience using the Singleton pattern.
For this exercise, you will turn a regular class into a singleton class that only allows one instance to be created.
This program contains a class called "Deck" for representing the set of 52 cards. It's possible that we want the same deck of cards to be available to all parts of our program, and that we only want one deck to be created.
For example, if we are writing a Blackjack game, there should only ever be one deck of cards. We would not want to accidentally create two decks and cause there to be duplicates of cards floating around. By making the class into a singleton, we make this impossible.
When you are done, please email your .java file to email@example.com.
Copyright © 2019 Ian Finlayson | Licensed under a Creative Commons Attribution 4.0 International License.