This page was exported from TechnicalStack [ http://technicalstack.com ]
Export date: Wed Oct 17 8:42:49 2018 / +0000 GMT

Lamda_AddExample



Example of Lamda Expression for addition of two int.

package com.technicalstack.basic;

interface Demo {

public void add(int a, int b);

}

public class Lamda_AddExample {

public static void main(String[] args) {

Demo d = (a, b) -> System.out.println("Sum is:" + (a + b));

d.add(10, 20);

d.add(100, 200);

}

}

Output:

Sum is:30

Sum is:300

 

 


Post date: 2018-08-27 15:40:02
Post date GMT: 2018-08-27 15:40:02
Post modified date: 2018-08-27 15:40:02
Post modified date GMT: 2018-08-27 15:40:02

Powered by [ Universal Post Manager ] plugin. MS Word saving format developed by gVectors Team www.gVectors.com