Skip to content

Instantly share code, notes, and snippets.

@juliofalbo
Created October 11, 2019 19:33
Show Gist options
  • Save juliofalbo/da90e5dc12e8236cd40a2aef15954304 to your computer and use it in GitHub Desktop.
Save juliofalbo/da90e5dc12e8236cd40a2aef15954304 to your computer and use it in GitHub Desktop.
public class FunctionalProgramming {
public static void main(String[] args) {
calc((a, b) -> a + b);
}
public static void calc(FunctionInterface functionInterface) {
Integer result = functionInterface.add(2, 2);
System.out.println(result);
}
}
interface FunctionInterface {
Integer add(int param1, int param2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment