In this tutorial, I saw an example of a user-defined lambda function.
Function<String, String> toLowerCase = (var input) -> input.toLowerCase();
What I am wondering is how can I call this function? I tried it in jshell but am unable to. I can create the function fine :
Any ideas?
jshell> Function<String, String> toLowerCase = (var input) -> input.toLowerCase();
toLowerCase ==> $Lambda$16/0x00000008000b3040@3e6fa38a
but can't seem to execute it :
jshell> String hi = "UPPER";
jshell> String high;
high ==> null
jshell> toLowerCase(high,low);
| Error:
| cannot find symbol
| symbol: method toLowerCase(java.lang.String,java.lang.String)
| toLowerCase(high,low);
| ^---------^
jshell>