Advertisement
Yuvalxp8

Check For Matching Dominos CONTRUCTOR

May 4th, 2017
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.51 KB | None | 0 0
  1. package defult;
  2.  
  3. import java.util.*;
  4.  
  5. public class Domino
  6. {
  7.     int x;
  8.     int y;
  9.  
  10.     public int getX()
  11.     {
  12.         return x;
  13.     }
  14.  
  15.     public void setX(int x)
  16.     {
  17.         this.x = x;
  18.     }
  19.  
  20.     public int getY()
  21.     {
  22.         return y;
  23.     }
  24.  
  25.     public void setY(int y)
  26.     {
  27.         this.y = y;
  28.     }
  29.    
  30.     public Domino(int x)
  31.     {
  32.         this.x = x;
  33.         this.y = x;
  34.     }
  35.    
  36.     public Domino()
  37.     {
  38.         this.x = (int)(Math.random() *6) +1;
  39.         this.y = (int)(Math.random() *6) +1;
  40.     }
  41.    
  42.     public String toString()
  43.     {
  44.         return this.x + "," + this.y;
  45.     }
  46.    
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement