We would like to know how to create Supplier Lambda and call get method.
import java.util.function.Supplier; /*from ww w. j av a 2 s . c o m*/ public class Main { public static void main(String[] args) { Supplier<Integer> rndRange = () -> (int) (Math.random() * 100); System.out.println(rndRange.get()); } }
The code above generates the following result.