Online Java Compiler By
JavaTpoint.com
import java.util.function.BiFunction; class Arithmetic{ public int add(int a, int b){ return a+b; } } public class InstanceMethodReference3 { public static void main(String[] args) { BiFunction
adder = new Arithmetic()::add; int result = adder.apply(10, 20); System.out.println(result); } }
Output