Why do lambdas in Java 8 disallow forward reference to member variables where anonymous classes don't?
问题 The following class contains a member variable runnable which is initialized with an instance of an anonymous inner class. The inner class references the same member: class Example { Runnable runnable = new Runnable() { @Override public void run() { System.out.println(runnable); } }; } This is not a problem as long as the method is not executed before the member has been assigned and the JLS allows such a reference. The declaration of the member variable could theoretically be converted to a