I always have to reassign my variable to another variable marked as final:
public void method(int myvar) {
myvar = myvar + 1;
doSomething(myvar); //I need to change myvar before the lambda
final int newvar = myvar; //this line is stupid
//could be something like:
//makefinal myvar;
open(con -> {
doOtherThing(newVar);
});
}
Would be really great if there was another way to declare that my variable will not be changed before the open call.
myvar + 1beforeopenfinalvariables.open, instead of assigning to another variablefinalsubsequently.finalvariable, in C# this is not needed