Thursday 30 November 2017

java - Odd syntax in API "String::concat"

I was looking at some of the changes made to the Java SE
API with 1.8, and I when looking at the new method href="http://docs.oracle.com/javase/8/docs/api/java/util/Map.html#merge-K-V-java.util.function.BiFunction-"
rel="noreferrer">Map.merge it shows an example of how to use it with the
line



map.merge(key, msg,
String::concat)



I
understand how to use a lambda expressions to create anonymous functional interfaces,
but this seems to use a method as a BiFunction. I like to understand and use obscure
java syntaxes, but I can't find any mention of this one anywhere.

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...