-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPoint.java
More file actions
65 lines (51 loc) · 1.23 KB
/
Copy pathPoint.java
File metadata and controls
65 lines (51 loc) · 1.23 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
public class Point {
private int x;
private int y;
private String color;
public Point(){
this.x = 0;
this.y = 0;
this.color = "black";
}
public Point(int x ,int y, String color){
this.x = x;
this.y = y;
this.color = color;
}
public Point(Point other){
this.x = other.x;
this.y = other.y;
this.color =other. color;
}
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 String getColor(){
return color;
}
public void setColor(String color){
this.color = color;
}
public String toString(){
return "\n X: " + this.x + "\n Y: " + this.y + "\n Color: " + this.color;
}
public double area(){
return 0.0;
}
public void translate (int dx, int dy){
this.x += dx;
this.y += + dy;
}
public boolean equals(Point other){
return this.x == other.x && this.y == other.y && this.color.equals(other.color);
}
}