Advertisement
zenados

Random Card Card

Oct 23rd, 2019
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.60 KB | None | 0 0
  1. public class Card {
  2.     private int number, colors;
  3.  
  4.     private static String[] Colors = { "Hearts", "Spades", "Diamonds", "Clubs" };
  5.     private static String[] Number  = { "Ace", "2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King" };
  6.  
  7.     Card(int Cardcolors, int Cardnumber){
  8.         this.number=Cardnumber;
  9.         this.colors=Cardcolors;
  10.     }
  11.  
  12.     public @Override String toString(){
  13.         return Number[number] + " of " + Colors[colors];
  14.     }
  15.  
  16.     public int getRank() {
  17.         return number;
  18.     }
  19.  
  20.     public int getSuit() {
  21.         return colors;
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement