I want to simply pass a lambda (chunk of code) and execute it when I need to. How do I implement the method executeLambda(...) in the code below (as well what is the method signature):
public static void main(String[] args)
{
String value = "Hello World";
executeLambda(value -> print(value));
}
public static void print(String value)
{
System.out.println(value);
}
public static void executeLambda(lambda)
{
someCode();
lamda.executeLambdaCode();
someMoreCode();
}