Last active
January 4, 2019 09:40
-
-
Save lgsantiago/e69d62e45d42ea7c183a2fcaeea4e19a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
https://gist.github.com/BuZZ-dEE/7307e56b9405b0f35d4036a19ca9e7c2