Questions tagged [default-method]

Java default methods allow you to add methods to interfaces.

Filter by
Sorted by
Tagged with
1
vote
5answers
517 views

Is this an anti pattern or misusing the interface default method?

Instead of checking the null and throwing exception each time we call findByOrderNumber method, I came up with this pattern by taking advantage of a default method, are there any patterns misused here ...
13
votes
1answer
1k views

Java Default Method Usage

For decades it's been the case that interfaces were only only (only) for specifying method signatures. We were told that this was the "right way to do things™". Then Java 8 came out and said: ...