public class Location
extends java.lang.Object
| Constructor | Description |
|---|---|
Location(int x,
int y) |
Location constructor takes an x and y
integer to track location of object
|
| Modifier and Type | Method | Description |
|---|---|---|
int |
getX() |
Gets the x-coordinate of the location
|
int |
getY() |
Get the y-coordinate of the location
|
void |
setX(int x) |
Changes the x-coordinate to the specified coordinate
|
void |
setY(int y) |
Changes the y-coordinate to the specified coordinate
|
public Location(int x,
int y)
x - x-coordinatey - y-coordinatepublic int getX()
public int getY()
public void setX(int x)
x - new x-coordinatex - new x-coordinatepublic void setY(int y)
y - new y-coordinatey - new y-coordinate