
Untitled
By: a guest on Feb 9th, 2010 | syntax:
Java | size: 0.64 KB | hits: 19 | expires: Never
{
private int x, y; // coordinates of shape
// constructor
public Shape( int x,
int y
)
{
this.x = x;
this.y = y;
}
// set x coordinate
public void setX( int x )
{
this.x = x;
}
// set y coordinate
public void setY( int y )
{
this.y = y;
}
// get x coordinate
public int getX()
{
return x;
}
// get y coordinate
public int getY()
{
return y;
}
{
return "Shape";
}
{
return "Shape";
}
} // end class Shape