forked from learning-zone/java-basics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJumper.java
More file actions
34 lines (27 loc) · 778 Bytes
/
Jumper.java
File metadata and controls
34 lines (27 loc) · 778 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
package SnakeNLadder;
import java.util.Objects;
public class Jumper {
int startPoint;
int endPoint;
public Jumper(int startPoint, int endPoint) {
this.startPoint = startPoint;
this.endPoint = endPoint;
}
public int getStartPoint() {
return startPoint;
}
public void setStartPoint(int startPoint) {
this.startPoint = startPoint;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Jumper jumper = (Jumper) o;
return startPoint == jumper.startPoint && endPoint == jumper.endPoint;
}
@Override
public int hashCode() {
return Objects.hash(startPoint, endPoint);
}
}