Yuvalxp8 icon

Check For Matching Dominos CONTRUCTOR

Yuvalxp8 | PRO | 05/04/17 06:32:10 AM UTC | 0 ⭐ | 545 👁️ | Never ⏰ | []
Java |

510 B

|

None

|

0 👍

/

0 👎

package defult;
 
import java.util.*;
 
public class Domino
{
    int x;
    int y;
 
    public int getX() 
    {
        return x;
    }
 
    public void setX(int x)
    {
        this.x = x;
    }
 
    public int getY()
    {
        return y;
    }
 
    public void setY(int y) 
    {
        this.y = y;
    }
    
    public Domino(int x)
    {
        this.x = x;
        this.y = x;
    }
    
    public Domino()
    {
        this.x = (int)(Math.random() *6) +1;
        this.y = (int)(Math.random() *6) +1;
    }
    
    public String toString()
    {
        return this.x + "," + this.y;
    }
    
}

Comments