I intend to generate a variable-length array, similar to link lists in plain C. For example, I define the following array
int [] a
Initially I assign 5 elements to the array as
a = new int[5]
for( k = 0; k < 5; k++
a[k] = k
Then I want to expand the array to 7 elements without discarding the original 5 elements. How to do