-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.java
25 lines (21 loc) · 842 Bytes
/
App.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
public class App
{
public static void main( String[] args )
{
// Inline anonymous class declaration
LambdaTest inlineTest = (var1, var2) -> { return var1 < var2 ? true : false;};
boolean test = inlineTest.test(300, 20);
System.out.println(test);
// Pass by reference method. Assuming if a method matches the signature in the interface.
LambdaTest lambdaTestSum = LambdaStaticReference::sum;
test = lambdaTestSum.test(20, 300);
System.out.println(test);
LambdaTest lambdaTest = LambdaStaticReference::test;
test = lambdaTest.test(2, 6);
System.out.println(test);
// Lambda Thread test
new Thread(()-> {
System.out.println("A thread created and running ...");
}).start();
}
}