java - Bypassing "final local variable defined in an enclosing type" -



java - Bypassing "final local variable defined in an enclosing type" -

i'm writing programme , i'm getting "the final local variable asd cannot assigned, since it's defined in enclosing type".

i provide illustration not code produces error aswell. have arraylist utilize later (if define within button can't utilize later on), outside of button, pressing button should give values arraylist. in illustration "create new arraylist" cause same problem.

button btn = new button("asd"); final arraylist asd = new arraylist(); btn.setonaction(new eventhandler<actionevent>() { public void handle(final actionevent event) { asd = new arraylist(); //here's error.. } });

clear arraylist , add together values.

java javafx

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -