Skip to content

Instantly share code, notes, and snippets.

@BuZZ-dEE
Forked from lgsantiago/NumericTest.java
Last active January 2, 2018 19:03
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 BuZZ-dEE/7307e56b9405b0f35d4036a19ca9e7c2 to your computer and use it in GitHub Desktop.
Save BuZZ-dEE/7307e56b9405b0f35d4036a19ca9e7c2 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));
}
@lgsantiago
Copy link

Good catch! Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment