StringFunction is functional interface. In other words the interface with single method.
StringFunction
Such interfaces could be implemented as a lambda as done in your example.
So here StringFunction exclaim = (s) -> s + "!"; the implementation is defined
StringFunction exclaim = (s) -> s + "!";