Commit be161a59 authored by Kelsi M. Riley's avatar Kelsi M. Riley
Browse files

Override the equals method of the Point class

parent 9d2fcc27
1 merge request!1Override the equals method of the Point class
Pipeline #9269 failed with stage
in 0 seconds
Showing with 8 additions and 0 deletions
+8 -0
...@@ -21,4 +21,12 @@ public class Point { ...@@ -21,4 +21,12 @@ public class Point {
int y = point.y; int y = point.y;
return (this.x == x && this.y == y); return (this.x == x && this.y == y);
} }
@Override
public boolean equals(Object o) {
if (o instanceof Point) {
return isEqual((Point) o);
}
return false;
}
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment