LAMBDA_DEMO

PHOTO EMBED

Wed May 29 2024 13:20:03 GMT+0000 (Coordinated Universal Time)

Saved by @signup

public class LambdaDemo
{
	public static void main(String[] args)
	{
		MyNum num = () -> 123.456;
		System.out.println("This is the value: " + num.getNum());
		
		num = () -> Math.random() * 100;
		System.out.println("This is the random value: " + num.getNum());
		System.out.println("This is one more random value: " + num.getNum());
	}
}
content_copyCOPY