Let's say you have an array of arrays,
-
int[][]array = new int[5][];
-
int i,j;
-
-
You initialize the arrays like so:
-
for (i = 0; i < 5; i++){
-
array[i] = new int[i+1];
-
}
Then you set the values of the array somewhere. eg, array[0][0] = some value, array [1][0] = another value, etc... When you want to print it, use a nested for loop like so, which gets the length of each of the arrays:
- for (i = 0; i < 5; i++){
-
int[] temp = array[i];
-
int len = temp.length;
-
for (j = 0; j < len; j++){
-
System.out.print(temp[j]+"\t");
-
}
-
System.out.println();
-
}
Don't know if you wanted arrays or a vector or something else. Eg, maybe you want to store all the number in the same array