_MuradPro_

Card

Jun 14th, 2020
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1. public class Card {
  2.     private int value;
  3.     private String shape;
  4.    
  5.    
  6.    
  7.     public Card(int value, String shape) {
  8.         this.value = value;
  9.         this.shape = shape;
  10.     }
  11.  
  12.  
  13.  
  14.     private int getValue() {
  15.         return value;
  16.     }
  17.  
  18.  
  19.     public String getShape() {
  20.         return shape;
  21.     }
  22.  
  23.  
  24.     public boolean equalValue(int num) {
  25.         if(this.value == num)
  26.             return true;
  27.         else
  28.             return false;
  29.     }
  30.    
  31.     public boolean isSameCard(Card card) {
  32.        
  33.         if(this.shape.equals(card.getShape()))
  34.             return true;
  35.         else
  36.             return false;
  37.     }
  38. }
Add Comment
Please, Sign In to add comment