- In scala == delegages to equals method.
- If you want to check referrential equality you call eq method.
- Case classes and Value Classes (2.10) get the equals and hashcode based on class parameters for free.
a == b is equivalent to a equals b
a eq b is true only if a and b are referrences to the same object
End of the story!
No comments:
Post a Comment