loop array using stream java

Solutions on MaxInterview for loop array using stream java by the best coders in the world

showing results for - "loop array using stream java"
Lara
07 May 2020
1int[] ns = new int[] {1,2,3,4,5};
2int[] ms = Arrays.stream(ns).map(n -> n * 2).filter(n -> n % 4 == 0).toArray();