Skip to content

Commit 6767172

Browse files
committed
added lambda code sample
1 parent ec690e4 commit 6767172

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

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

0 commit comments

Comments
 (0)