Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dev-oo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ethan Robert
dev-oo
Commits
6691db5b
Commit
6691db5b
authored
2 months ago
by
Ethan Robert
Browse files
Options
Downloads
Patches
Plain Diff
Minor changes to Person
parent
cea3173f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/tp04/Person.java
+9
-3
9 additions, 3 deletions
src/tp04/Person.java
with
9 additions
and
3 deletions
src/tp04/Person.java
+
9
−
3
View file @
6691db5b
package
tp04
;
public
class
Person
{
public
class
Person
{
private
int
ID
;
final
private
int
ID
;
private
String
forename
;
private
String
forename
;
private
String
name
;
private
String
name
;
private
static
int
counter
;
private
static
int
counter
;
public
Person
(
String
name
,
String
fore
name
)
{
public
Person
(
String
fore
name
,
String
name
)
{
this
.
forename
=
forename
;
this
.
forename
=
forename
;
this
.
name
=
name
;
this
.
name
=
name
;
...
@@ -39,8 +41,12 @@ public class Person {
...
@@ -39,8 +41,12 @@ public class Person {
}
}
public
boolean
equals
(
Object
other
)
{
public
boolean
equals
(
Object
other
)
{
if
(
other
==
null
)
{
return
false
;
}
if
(
other
.
getClass
()
==
this
.
getClass
())
{
if
(
other
.
getClass
()
==
this
.
getClass
())
{
return
other
.
ID
==
this
.
ID
;
Person
otherPerson
=
(
Person
)
other
;
return
otherPerson
.
getID
()
==
this
.
ID
;
}
}
return
false
;
return
false
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment