C
C
click_f2016-09-20 17:49:50
Java
click_f, 2016-09-20 17:49:50

What are "default methods" used for in practice?

In most articles about default methods, almost everything is written, except for one extremely important detail, what are they motivated by?
What are they used for in practice?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sirs, 2016-09-20
@click_f

In java 8 default methods were added primarily to add new methods to old interfaces and maintain compatibility with existing code.
The most striking example is the Collection interface and the stream
method PS Very good discussion here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question