//: innerclasses/UnboundMethodReference.java // Method reference without an object. import java.util.*; import java.util.function.*; import static net.mindview.util.Print.*; class X { String f() { return "X.f()"; } } public class UnboundMethodReference { public static void main(String[] args) { Function len = String::length; print(len.apply("UnboundMethodReference")); List words = Arrays.asList("Rain", "Spain", "Plain"); words.forEach(System.out::println); Function xfr = X::f; print(xfr.apply(new X())); } } ///:~