public class Main public static void main String args MyArrayCollectio

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
public class Main {
public static void main(String[] args) {
MyArrayCollection q = new MyArrayCollection();
q.array = new int[] {1, 2, 3, 4, 5, 0, 0, 0, 0, 0};
q.size = 5;
q.add(8);
MyArrayCollection g = new MyArrayCollection();
g.array = new int[] {1, 3, 4, 6, 7};
q.addAll(g);
for (int i = 0; i < q.size(); i++) {
System.out.print(q.array[i] + " ");
}
}
}