This is the final code which meets your requirement.Than you Card.java import java.util.Random; public class Card { //declaring instance variables private String suit; private int face_value; public static int count=52; //Creating an instance of Random class reference Random rand; //Default Constructor public Card() { super(); //Passing random class object to the Random class reference rand = new Random(); } //Getters and setters public String getSuit() { return suit; } public void setSuit(String suit) { this.suit = suit; } public int getFace_value() { return face_value; } public void setFace_value(int face_value) { this.face_value = face_value; } public int getCount() { return count; } //This shuffle() method will shuffle the deck public void shuffle() { //Picking a card from the deck randomly and find its face value and suit this.face_value = 1 + rand.nextInt((9) + 1); int suit_random_value = 1 + rand.nextInt((3) + 1); if(suit_random_value==1) { this.suit=\"Clubs\"; } else if(suit_random_value==2) { this.suit=\"hearts\"; } else if(suit_random_value==3) { this.suit=\"Spades\"; } else if(suit_random_value==4) { this.suit=\"diamonds\"; } this.count=count-1; } } ________________________________________________________________________ DriverClass.java public class DriverClass { public static void main(String[] args) { //creating an array which can hold 52 Card class Objects Card c[]=new Card[52]; //Creating 52 card class objects and storing them into an array for(int i=0;i<52;i++) { //Creating Card class Object c[i]=new Card(); } //Displaying each card face value and its suit. for(int i=0;i<52;i++) { //Shuffling the deck before every card picking from the deck c[i].shuffle(); //Displaying randomly picked card face value and its suit System.out.println(c[i].getFace_value()+\" of \"+c[i].getSuit()+\" Cards remaining \"+c[i].getCount()); } } } _________________________________________________________________________ Output: 8 of diamonds Cards remaining 51 4 of Clubs Cards remaining 50 9 of Clubs Cards remaining 49 7 of Spades Cards remaining 48 9 of diamonds Cards remaining 47 7 of diamonds Cards remaining 46 4 of diamonds Cards remaining 45 9 of Clubs Cards remaining 44 5 of hearts Cards remaining 43 7 of Spades Cards remaining 42 10 of Clubs Cards remaining 41 7 of diamonds Cards remaining 40 8 of diamonds Cards remaining 39 6 of hearts Cards remaining 38 4 of hearts Cards remaining 37 6 of Spades Cards remaining 36 4 of Clubs Cards remaining 35 3 of diamonds Cards remaining 34 9 of diamonds Cards remaining 33 3 of diamonds Cards remaining 32 5 of Spades Cards remaining 31 4 of Clubs Cards remaining 30 3 of Spades Cards remaining 29 6 of diamonds Cards remaining 28 3 of hearts Cards remaining 27 9 of hearts Cards remaining 26 7 of hearts Cards remaining 25 3 of hearts Cards remaining 24 10 of Clubs Cards remaining 23 2 of hearts Cards remaining 22 9 of Clubs Cards remaining 21 8 of diamonds Cards remaining 20 8 of Clubs Cards remaining 19 2 of h.