JavaLamda1
  • Nut bolts of Lambda expression:
Script :

public class JavaTemplate1 {
// private static String dbURL;
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
int x1 = 12; int x2 = 2;
IntMultiply mlt1 =
(Integer s1)-> s1 * x2;
System.out.println
(x1 + " times "+ " result " + mlt1.n1(x1));
}
}
interface IntMultiply{
public Integer n1(Integer s1);
}

Result : Runtime Views with NetBean 8.x

Command line :