Page 1 of 1

About Question enthuware.ocajp.i.v8.2.1472 :

Posted: Mon Oct 29, 2018 4:10 pm
by bhuva78
Why does it fail to compile?

Re: About Question enthuware.ocajp.i.v8.2.1472 :

Posted: Thu Jan 10, 2019 2:57 pm
by crazymind
lambda expression does not create a new scope for variables.Therefore, you cannot reuse the local variable names that have already been used in the enclosing method
So e's scope is between the parentheses "(e, e->e.age<10000)" ?

Re: About Question enthuware.ocajp.i.v8.2.1472 :

Posted: Fri Jan 11, 2019 12:06 am
by admin
Yes, you can try it out. Use the the variable specified in the lambda expression after the expression and see what happens.

Re: About Question enthuware.ocajp.i.v8.2.1472 :

Posted: Sun Dec 22, 2024 8:53 am
by raphaelzintec
this one is very funny cuz i answeared 'It will compile fine and print true when run.' but then i went back cuz i realized the question was too easy, like something is missing, the trickyness is missing, so ye i doublechecked and found lol