-
-
Save BuZZ-dEE/7307e56b9405b0f35d4036a19ca9e7c2 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
Good catch! Thanks