import java.util.Scanner; interface Test { boolean check(int n); } public class LambdaTest { public static void main(String[] args) { Scanner scan = new Scanner(System.in); Test isEven = n -> (n % 2) == 0; Test isNonNegative = n -> n >= 0; System.out.print("Enter a number: "); int x = scan.nextInt(); System.out.println(x + " is even? " + isEven.check(x)); System.out.print("Enter another number: "); x = scan.nextInt(); System.out.println(x + " is non-negative? " + isNonNegative.check(x)); } }