Accessing Outer Class Local Variables from Inner Class Methods
When you try to compile the following Java code, you will get this error, local variable a is accessed from within inner class; needs to be declared final public class Outer { public void test() { int a = 10; Runnable i = new Runnable() { @Override public void run() { int j = a […]