Skip to content

Commit 7c01aa3

Browse files
committed
added Supplier example
1 parent 12844cb commit 7c01aa3

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package java8.functionalInterface;
2+
3+
import java.util.Random;
4+
import java.util.function.Supplier;
5+
6+
public class SupplierInterfaceDemo
7+
{
8+
public static void main(String[] args)
9+
{
10+
Supplier<Integer> supplier=()->new Random().nextInt(20);
11+
System.out.println(supplier.get());
12+
}
13+
}

0 commit comments

Comments
 (0)