public class Point private int public Point int int this this public i

 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
39
40
41
42
43
44
45
public class Point
{
private int x, y;
public Point(int x, int y)
{
this.x = x;
this.y = 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 boolean isValid(int N)
{
return x >= 0 && y >= 0 && x < N && y < N;
}
@Override
public String toString()
{
return "Point{" +
"x=" + x +
", y=" + y +
'}';
}
}