We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7c55cde commit 1644f75Copy full SHA for 1644f75
1 file changed
lambda/JavaLambdaEx3.java
@@ -0,0 +1,21 @@
1
+package com.zetcode;
2
+
3
+@FunctionalInterface
4
+interface Addition {
5
6
+ public int add(int a, int b);
7
+}
8
9
+public class JavaLambdaEx3 {
10
11
+ public static void main(String[] args) {
12
13
14
+ Addition addition = (x, y) -> (x + y);
15
16
+ System.out.println(addition.add(4, 5));
17
+ System.out.println(addition.add(5, 5));
18
+ System.out.println(addition.add(6, 6));
19
20
+ }
21
0 commit comments