Skip to content

Instantly share code, notes, and snippets.

@ahgittin
Created September 16, 2015 11:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahgittin/4df85bbdaec4240566dd to your computer and use it in GitHub Desktop.
Save ahgittin/4df85bbdaec4240566dd to your computer and use it in GitHub Desktop.
interface Function2 { int apply(int a, int b); }
int factorial(int n) { return applyFromOneToN(new Function2() { int apply(int a, int b) { return a*b; } }, n); }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment