Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.ArrayList;
- import java.util.Random;
- public class Main {
- public static void main(String[] args) {
- ArrayList<Integer> myaw = new ArrayList<>();
- Random random = new Random();
- for (int i = 0; i < 10; i++) {
- myaw.add(random.nextInt(200)-100);
- }
- myaw.stream()
- .filter(x -> x % 3 == 0)
- .map(Math::abs)
- .forEach(System.out::println);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement