Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

howitzerg
Copy link

Create new Contact class - parent class of Address, Email and Phone classes.

Extract common variables and methods.

…lasses.

Extract common variables and methods.
Copy link

@bongbongbee bongbongbee left a 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() {
Copy link

@bongbongbee bongbongbee Sep 17, 2016

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();

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants