Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java skip foreach

List<Integer> numList = Arrays.asList(10,21,31,40,59,60);
numList.forEach( x-> {
    if( x%2 == 0) {
        return; // only skips this iteration.
    }
    System.out.println(x);
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #java #skip #foreach
ADD COMMENT
Topic
Name
9+1 =