Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

reference to an instance method of an arbitrary object of a particular type

The lambda equivalent of

 String::compareToIgnoreCase
would be

(String a, String b) -> a.compareToIgnoreCase(b)
// 2
String::toLowerCase;

(String someString) -> someString.toLowerCase();
//3

Function<Long, Double> converter = Long::doubleValue;
Function<Long, Double> converter = val -> val.doubleValue();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #reference #instance #method #arbitrary #object #type
ADD COMMENT
Topic
Name
3+1 =