Overriding the equals method seems simple, but there are many ways to get it wrong, and consequences can be dire.
The easiest way to avoid problems is not to override the equals method, in which case each instance of the class is equal only to itself.
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/15966.html