Add java11-features module: runnable demos and captured output for the ankurm.com java11-features article
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
/** Fails to compile on purpose: you cannot mix var and explicit types in one lambda's parameters. */
|
||||
public class VarWithoutLambda {
|
||||
public static void main(String[] args) {
|
||||
BiFunction<Integer, Integer, Integer> f = (var a, Integer b) -> a + b;
|
||||
System.out.println(f.apply(1, 2));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user