Skip to content

Instantly share code, notes, and snippets.

@sidazhou
Created November 29, 2019 12:27
Show Gist options
  • Save sidazhou/b7f49fc90819b81b0119e9f00ac0ffe7 to your computer and use it in GitHub Desktop.
Save sidazhou/b7f49fc90819b81b0119e9f00ac0ffe7 to your computer and use it in GitHub Desktop.
Oh god this works
public class Temp {
public static int myf(int i, int j, Function<List<Integer>,Integer> fn) {
System.out.println("start");
List<Integer> myi= new ArrayList<>();
myi.add(i);
myi.add(j);
int retval = fn.apply(myi);
System.out.println(retval);
System.out.println("end");
return retval;
}
public static void main(String[] args) {
myf(13, 12, list -> list.get(0) + list.get(1)) ;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment