public class Main {
public static void main(String[] args) {
int[] smallArray = { 1, 2, 3, 4, 5 };
int[] largeArray = new int[30];
int largeLen = largeArray.length;
int smallLen = smallArray.length;
for (int i = 0; i < largeLen; i++) {
largeArray[i] = smallArray[i % smallLen];
}
for (int i = 0; i < largeLen; i++) {
System.out.print(largeArray[i] + " ");
}
}
}
/*
run:
1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5
*/