-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
22 lines (18 loc) · 856 Bytes
/
Copy pathMain.java
File metadata and controls
22 lines (18 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package com.company;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class Main {
public static void main(String[] args) { // void не возрашает данные
System.out.println("От класса Main");
List<Integer> intList = Arrays.asList(1, 2, 5, 16, -1, -2, 0, 32, 3, 5, 8, 23, 4);
Collections.sort(intList); // Используется для сортировки элементов, присутствующих в указанном списке коллекции, в порядке возрастания.
for (int x : intList) {
if (x > 0 && x % 2 == 0)
System.out.println(x);
}
System.out.println();
System.out.println("От класса StreamMain");
StreamMain.main(intList);
}
}