Page 1 of 1

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

Posted: Fri Oct 11, 2019 3:52 am
by TamasBuri
Hi,

there isn't any short tutorial on that page:
http://enthuware.com/index.php/home/115

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

Posted: Fri Oct 11, 2019 4:01 am
by admin
It has been moved to: https://enthuware.com/lambda-for-ocajp
Updated.
thank you for your feedback!

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

Posted: Fri Oct 11, 2019 8:06 am
by TamasBuri
Your welcome :)

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

Posted: Thu Nov 07, 2019 6:41 pm
by DazedTurtle
Observe that without the brackets over a, b, it would imply that you are trying to pass 3 arguments to processList method - a, b, and b->System.out.println(a*b), which is incorrect. You actually want to pass only two arguments - a and the lambda expression. Therefore, whenever the method of a functional interface takes more than one parameter, you need to put the arguments within brackets.
I believe this should be (changes in bold):
Observe that without the brackets over a, b, it would imply that you are trying to pass 3 arguments to processList method - al, a, and b->System.out.println(a*b), which is incorrect. You actually want to pass only two arguments - al and the lambda expression. Therefore, whenever the method of a functional interface takes more than one parameter, you need to put the arguments within brackets.

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

Posted: Thu Nov 07, 2019 10:32 pm
by admin
Correct. Fixed.
thank you for your feedback!