About Question enthuware.ocpjp.v7.2.1515 :

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
Wisevolk
Posts: 33
Joined: Thu Jul 18, 2013 6:06 pm
Contact:

About Question enthuware.ocpjp.v7.2.1515 :

Post by Wisevolk »

I don't agree with the answer.

It's true to say we can't be sure about equality of two object with the hascode method.

but, for inequality it's the same as 2 non equal objects should have the same hascode. So testing the inequality with a hascode can't give a sure answer about inequality.

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

Re: About Question enthuware.ocpjp.v7.2.1515 :

Post by admin »

This is what it means - if the two hashcodes are equal, we can't say whether the objects are equal or not. But if two hashcodes are not equal, we can be sure that the objects are not equal.

HTH,
Paul.

DesRenthuware
Posts: 32
Joined: Wed Aug 28, 2013 6:12 am
Contact:

Re: About Question enthuware.ocpjp.v7.2.1515 :

Post by DesRenthuware »

Two typos:

"...the equals and hashCode contracted not violated..."

and

"...if the hash codes for two objects is same, you..."

Cheers

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

Re: About Question enthuware.ocpjp.v7.2.1515 :

Post by admin »

Fixed.
thank you for your feedback!
Paul.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest