Extension methods and equals()/hashCode()

Brian Goetz brian.goetz at oracle.com
Sun Aug 5 10:10:41 PDT 2012

The answer is no :)

The EG has discussed this item at length. I'm preparing a writeup on this and other topics that will highlight the pros and cons of allowing this.  (Bottom line was: the limited benefit (and it is more limited than you initially think) was not worth the cost in complicating the model of how inheritance works for default methods.)  

On Aug 5, 2012, at 12:07 AM, Jose wrote:

> I pretty sure the answer is no, but I'll give a try.
> It would be possible to adapt extensions methods so that they could be used
> to define the equals()/hashCode() or the toString() behaviour of a type?

More information about the lambda-dev mailing list