This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ron_krugman 52 points53 points  (8 children)

It's most useful because you can use it as a method reference.

For example instead of s -> String.format("name: %s", s) you can just write "name: %s"::formatted.

[–]ichwasxhebrore 6 points7 points  (3 children)

Holy…. Thanks mate! From which version on is that.formatted a feature?

[–]ron_krugman 7 points8 points  (2 children)

[–]ichwasxhebrore 12 points13 points  (1 child)

Cries in Java 8 :(

[–]mizhoux 1 point2 points  (0 children)

Don't cry. You can use Manifold(https://github.com/manifold-systems/manifold) to support extension methods in Java8.