I was playing around in Java
and I tried to initialize a variable with a lambda expression
however, when trying to use the variable I get the error
java: cannot infer type for local variable test (lambda expression needs an explicit target-type)
public static void main(String[] args){
var test = (e -> {
return 10;
});
Arrays.stream(new int[]{3})
.map(test)
.forEach(System.out::println);
}
Honestly, I was just trying to initialize a variable using a method
and it just sort of became lambda so I just played around with lambda