-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[T4A3][T17-B3]Sin Yu Fan #1692
base: master
Are you sure you want to change the base?
[T4A3][T17-B3]Sin Yu Fan #1692
Conversation
…lasses. Extract common variables and methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All in all a good attempt at implementing Inheritance
.
&& this.value.equals(((Phone) other).value)); // state check | ||
} | ||
|
||
@Override | ||
public int hashCode() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the rationale behind overriding the hashCode() method? Or did you forget to remove this?
&& this.value.equals(((Phone) other).value)); // state check | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return value.hashCode(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm..the value variable does not exist in your Phone
class already. Can this class file still compile?
Create new Contact class - parent class of Address, Email and Phone classes.
Extract common variables and methods.