Skip to content

Instantly share code, notes, and snippets.

@lgsantiago
Last active January 4, 2019 09:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lgsantiago/e69d62e45d42ea7c183a2fcaeea4e19a to your computer and use it in GitHub Desktop.
Save lgsantiago/e69d62e45d42ea7c183a2fcaeea4e19a to your computer and use it in GitHub Desktop.
interface NumericTest {
boolean computeTest(int n);
}
public static void main(String args[]) {
NumericTest isEven = (n) -> (n % 2) == 0;
NumericTest isNegative = (n) -> (n < 0);
// Output: false
System.out.println(isEven.computeTest(5));
// Output: true
System.out.println(isNegative.computeTest(-5));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment