3 ms·
Yes. The feature has been proposed for Java too: "defender methods". Originally I resisted them on the grounds of not being necessary, but they're used all ove
by pcwalton 12y ago
Yes. The feature has been proposed for Java too: "defender methods".
Originally I resisted them on the grounds of not being necessary, but they're used all over now. Being able to supply a default implementation is extremely useful.
- oldmanjay 12y agoQuick correction: Java 8 does have defender methods.
- EugeneOZ 12y agoThanks to all for explanations! :) And now I think Traits are traits, but can be used as interfaces too :)
- kzrdude 12y agodefault method implementations makes traits behave like mixins, it's very useful (and it is a form of code reuse).
- pcwalton 12y agoTotally agreed. I was wrong to resist them :)
- deleted 12y ago[deleted]