About Question enthuware.ocpjp.v8.2.1808 :

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
__JJ__
Posts: 125
Joined: Thu Jul 05, 2018 6:44 pm
Contact:

About Question enthuware.ocpjp.v8.2.1808 :

Post by __JJ__ »

You should think about what would be an appropriate implementation of the hashCode method if you use this code for the equals method.
Surely the only possible implementation is that all objects get the same hashCode? Equal objects must have an equal hashCode, no?

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v8.2.1808 :

Post by admin »

Correct. You got it :)
If you like our products and services, please help us by posting your review here.

__JJ__
Posts: 125
Joined: Thu Jul 05, 2018 6:44 pm
Contact:

Re: About Question enthuware.ocpjp.v8.2.1808 :

Post by __JJ__ »

OK great, thanks very much.

NickRobinson
Posts: 1
Joined: Thu May 31, 2018 4:58 am
Contact:

Re: About Question enthuware.ocpjp.v8.2.1808 :

Post by NickRobinson »

The answer for the second option states "Therefore, you cannot override it with a method whose argument has a different return type." Should this be "reference type" ? The return type is boolean in both cases.

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v8.2.1808 :

Post by admin »

Yes, it should be "reference" not "return". Fixed.
thank you for your feedback!
If you like our products and services, please help us by posting your review here.

crazymind
Posts: 85
Joined: Mon Dec 24, 2018 6:24 pm
Contact:

Re: About Question enthuware.ocpjp.v8.2.1808 :

Post by crazymind »

admin wrote:
Tue Jul 31, 2018 11:09 pm
Correct. You got it :)
Can I return isbn or name for hashcode in this case? cause they are both subset of variables that equals use.

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v8.2.1808 :

Post by admin »

Yes, but always post code to make sure there is no misunderstanding about your question.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 21 guests