getter as method reference
package ch.claude_martin;
import java.util.function.ToIntFunction;
public class Foo {
private int getBla(Foo this) {
return 42;
}
public static void main(String[] args) {
ToIntFunction<Foo> ref = Foo::getBla;
System.out.println(ref.applyAsInt(new Foo()));
}
}
Comments