Towards the end of this section in a oracle tutorial of lambda expressions it seems as if it is saying that x is referring to a member in the enclosing class of the method, but since the method has a parameter reference identical to x I think it refers to the local parameter and not a member of the enclosing class.
For example, the lambda expression directly accesses the parameter x of the method methodInFirstLevel. To access variables in the enclosing class, use the keyword this. In this example, this.x refers to the member variable FirstLevel.x.
But then the tutorial seems to immediately contradict itself:
However, like local and anonymous classes, a lambda expression can only access local variables and parameters of the enclosing block that are final or effectively final. For example, suppose that you add the following assignment statement immediately after the methodInFirstLevel definition statement:
void methodInFirstLevel(int x) {
x = 99;
// ...
}
Because of this assignment statement, the variable FirstLevel.x is not effectively final anymore.
What? The assignment in that example method is x = not this.x = so how does that assignment affect FirstLevel.x at all?