I have a problem with the stream of Java 8 foreach attempting to move on next item in loop. I cannot set the command like continue;
, only return;
w
The lambda you are passing to forEach()
is evaluated for each element received from the stream. The iteration itself is not visible from within the scope of the lambda, so you cannot continue
it as if forEach()
were a C preprocessor macro. Instead, you can conditionally skip the rest of the statements in it.