Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs2-19wi
lab09
Commits
aa419461
Commit
aa419461
authored
6 years ago
by
Ethan Ordentlich
Browse files
Options
Download
Email Patches
Plain Diff
Correct equals in Point.java
parent
fc1d0019
master
patch-1
1 merge request
!1
Correct equals in Point.java
Pipeline
#10062
failed with stage
in 0 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/edu/caltech/cs2/lab09/Point.java
+6
-3
src/edu/caltech/cs2/lab09/Point.java
with
6 additions
and
3 deletions
+6
-3
src/edu/caltech/cs2/lab09/Point.java
View file @
aa419461
...
...
@@ -28,9 +28,12 @@ public class Point {
*/
@Override
public
boolean
equals
(
Point
point
)
{
if
(
point
==
null
)
return
false
;
int
x
=
point
.
x
;
int
y
=
point
.
y
;
if
(!(
point
instanceof
Point
))
{
return
false
;
}
Point
p
=
(
Point
)
point
;
int
x
=
p
.
x
;
int
y
=
p
.
y
;
return
(
this
.
x
==
x
&&
this
.
y
==
y
);
}
}
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help