diff options
Diffstat (limited to 'tests/com/jsyn/research/lambdas')
-rw-r--r-- | tests/com/jsyn/research/lambdas/LambdaUnits.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/com/jsyn/research/lambdas/LambdaUnits.java b/tests/com/jsyn/research/lambdas/LambdaUnits.java new file mode 100644 index 0000000..42807ac --- /dev/null +++ b/tests/com/jsyn/research/lambdas/LambdaUnits.java @@ -0,0 +1,22 @@ +package com.jsyn.research.lambdas; + +import java.util.function.BinaryOperator; + +public class LambdaUnits { + + + public static void main(String[] args) { + test(); + } + + void tryLambda(BinaryOperator<Double> op) { + double result = op.apply(3.0, 4.0); + System.out.println("result = " + result); + } + + private static void test() { + System.out.println("Test Lambdas"); + // Need Java 8! tryLambda((x, y) -> (x * y)); + } + +} |