I need to change the size of an array, but I cannot simply create another – It needs the same name so I can pass it to a method. Specifically, I need the array to have twice as many terms as it used to. Is this possible to do with one array? Can I copy data from array A to array B, then make A reference the same data as B with A = B; ?
Share
Yes, your array variable may reference an array of the same type but different size.
For changing it internally, an ArrayList might be more easy to use.