Check For Matching Dominos CONTRUCTOR
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