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

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
bhuva78
Posts: 1
Joined: Mon Oct 29, 2018 4:08 pm
Contact:

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

Post by bhuva78 »

Why does it fail to compile?

crazymind
Posts: 85
Joined: Mon Dec 24, 2018 6:24 pm
Contact:

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

Post 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)" ?

admin
Site Admin
Posts: 10046
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin »

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 65 guests