About Question enthuware.ocajp.i.v8.2.1472 :
Moderator: admin
-
- Posts: 1
- Joined: Mon Oct 29, 2018 4:08 pm
- Contact:
About Question enthuware.ocajp.i.v8.2.1472 :
Why does it fail to compile?
-
- Posts: 85
- Joined: Mon Dec 24, 2018 6:24 pm
- Contact:
Re: About Question enthuware.ocajp.i.v8.2.1472 :
So e's scope is between the parentheses "(e, e->e.age<10000)" ?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
-
- Site Admin
- Posts: 10046
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v8.2.1472 :
Yes, you can try it out. Use the the variable specified in the lambda expression after the expression and see what happens.
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: No registered users and 65 guests