Why there is no Hashable interface in Java
hashcode, interface, java
Solution
The major argument seems to me that there is a well-defined default `hashCode` that can be calculated for any Java object, along with an equally well-defined `equals`. There is simply no good reason to withhold this function from all objects, and of course there are plenty reasons not to withhold it. So it's a no-brainer in my book.
Problem
`Object` in Java has `hashCode` method, however, it is being used only in associative containers like `HashSet` or `HashMap`. Why was it designed like that? `Hashable` interface having `hashCode` method looks as much more elegant solution.