-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathArray55.java
More file actions
31 lines (27 loc) · 703 Bytes
/
Array55.java
File metadata and controls
31 lines (27 loc) · 703 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package array;
import array.uitl.ArrayUtil;
/**
* Project Admin -> Husanboy Azamov
* Package Name -> array
* Class Name -> Array55
* Copyright © : 6/26/2022
*/
public class Array55 {
public static void main(String[] args) {
array55(new int[]{
1,2,3,4,5,6,7,8
});
}
public static void array55(int[] array1){
int counter=0;
int[] array2 =new int[array1.length];
for (int i = 0; i < array1.length; i++) {
if (array1[i]%2!=0){
array2[counter]=array1[i];
counter++;
}
}
System.out.println("Array Size:"+counter);
ArrayUtil.show(array2);
}
}