I'm hoping one of the resident
Java experts here can explain this to me.
I've been studying for my OCP certification and I've come across something I don't understand.
Note: the code below is non-sense and not meant to do anything real but rather to illustrate the behavior that I'm curious about. I would never write production code like this but I can't help but be puzzled as to why it works this way.
The following code compiles w/o issue
if I move the final two lines of that block above the predicate definition it doesn't compile and it instead complains that I'm attempting to redeclare c & start inside my predicate.
I assume this is something about how Java deals with lambda methods but why does having the declarations for c & start before the predicate cause issues while having them below does not?