Skip to content

Commit 27bb83e

Browse files
committed
commit changesd
1 parent 042e2b7 commit 27bb83e

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package java8.lambda;
2+
3+
public interface Calculator {
4+
int add(int a,int b);
5+
}

java8Tutorials/src/main/java/java8/lambda/LambdaDemo2.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
package java8.lambda;
22

3-
interface Calculator
4-
{
5-
int add(int a,int b);
6-
}
73
/**
84
*
95
* @author saurav
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package java8.lambda;
2+
/**
3+
*
4+
* @author saurav
5+
*
6+
*/
7+
public class LambdaDemo3
8+
{
9+
private static int add(int x,int y)
10+
{
11+
return x+y;
12+
}
13+
public static void main(String[] args)
14+
{
15+
// Reference to a static method
16+
Calculator calc=LambdaDemo3::add;
17+
System.out.println(calc.add(10,10)); // output : 20
18+
}
19+
}

0 commit comments

Comments
 (0)