Java 7 was saying "Cannot refer to the non-final local variable message defined in an enclosing scope" on following code:
public class Runner {
public static void main(String[] args) {
String message = "Hello world";
new Runnable() {
@Override
public void run() {
System.out.println(message);
}
}.run();
}
}
Java 8 does not.
Suspect this is about adding functional programming features to Java.
Does it process the code similarly?