Java provides way to define comparison of object outside scope Object using `Comparator`.
Now my questions is why java does not allow do same for equals() and hashcode().
Now each collection `contains()` method can easily use this external equality provider to check objects are equal. Currently the only way to do this is to create a wrapper for keys/elements. Trove4j supports custom HashingStrategies. trove4j.sourceforge.net/javadocs/gnu/trove/strategy/â€¦
以上就是Why Java does not support Equality comparison on the Lines of Comparator?的详细内容，更多请关注web前端其它相关文章！