Hack Bulgaria
github.com/HackBulgaria
int[] a = new int[10];
for (int i = 0; i < 10; i++) {
a[i] = i;
}
for(int i = 0; i < 10; i++ ) {
System.out.print(a[i] + " ");
}
0 1 2 3 4 5 6 7 8 9
int [] b = new int[20];
for (int i = 0; i < 10; i++) {
b[i] = a[i];
}
for(int i = 0; i < 20; i++ ) {
System.out.print(b[i] + " ");
}
0 1 2 3 4 5 6 7 8 9 0 0 0 0 0 0 0 0 0 0
IntegerVector numbers = new IntegerVector();
numbers.add(10);
numbers.add(5);
System.out.println(numbers.size()); // 2
System.out.println(numbers.get(0)); // 10
add(item) - Добавяне на елемент в края на вектора.
By Hack Bulgaria