I am reading CoreJava chapter on Lambda Expression and i couldn't understand the below paragraph.
In fact, conversion to a functional interface is the only thing that you can do with a lambda expression in Java. In other programming languages that support function literals, you can declare function types such as (String, String) -> int, declare variables of those types, and use the variables to save function expressions. However, the Java designers decided to stick with the familiar concept of interfaces instead of adding function types to the language
Can someone explain what a function literal or types is in terms of C++? I know the statement (string, string) -> int is allowed in C++ which allows to define return type. Java/C++ has parameter types too. So i am confused and not sure what the author is trying to say. Not sure if author is referring to closure for example in C++ closure has its state (captured variables). However it seems the author is comparing Java lambda expression with Scala but i don't know Scala at all.
Appreciate any insight.