Coordinate.java
386 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package pad.prac1;
public class Coordinate
{
private int xPos;
private int yPos;
public Coordinate(int x, int y)
{
xPos = x;
yPos = y;
}
public int x()
{
return xPos;
}
public int y()
{
return yPos;
}
public void setX(int x)
{
xPos = x;
}
public void setY(int y)
{
yPos = y;
}
public String toString()
{
return "("+xPos+","+yPos+")";
}
}