#java hash
1 messages ยท Page 1 of 1 (latest)
While you are waiting for getting help, here are some tips to improve your experience:
If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.
Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.
Why do you expect them to be equal?
Thats just the test for this two Methods
And ?
Why do you expect them to be equal?
I uploaded your attachments as gist. That way, they are easier to read for everyone, especially mobile users ๐
You still are not answering my questions
Then answer my question please
Why do you expect them to be equal?
idk its just the given test that expects that, the hascode must be the same
which of the asserts is failing?
ur implementation is definitely wrong
ur equals allows for a delta difference
ur hashcode not
but equals and hashcode have to line up
a equals shouldn't have a delta anyway ๐ค
Detected code, here are some useful tools:
that's not what i asked
that test has 4 asserts and i wanted to know which of them fails
well. what's unclear to u? the previous explanation should have been quite straightforward
like, the issue should be clear, no?
ur equals method would for example say that a number 2.00001 is the same as 2.00002
but ur hashcode considers them different and spits out a different hashcode
that's incorrect
they both have to have the same logic
either let both correctly use the delta or none
Closed the thread due to inactivity.
If your question was not resolved yet, feel free to just post a message to reopen it, or create a new thread. But try to improve the quality of your question to make it easier to help you ๐