#Equals and hashCode problem
1 messages · Page 1 of 1 (latest)
dont ask to ask
just directly ask your question
otherwise we cant really help
uh no? stick to this channel please
ok
show full class please
good equals implementation?:)
I uploaded your attachments as Gist.
@main beacon I don't understand what this class is about
The names sound like chess but the way the class is done, it doesn't sound like a chess engine 
Sound correct
By the way, don't forget to put final on everything that cannot change
And don't use clonable
ok, thank you very much 🙂
IntelliJ will generate them for you. Just click on a class, generate and then Equals and Hashcode
Same with toString
don’t waste your time implementing them yourself
the compiler can always do it better
Thats not true
It depends on the situation
yeah, the compiler is good at handling most situations, it gives a good distribution for general case. but it doesnt always do it better, based on the situation
sure but I’ve never run into a case where I could make a better equals and hashcode function than intelliJ
its a good tool, if you cant use records or lombok
