Originally posted by kevin schmidt:
Hi,
If you are done with an element inside an array, how do you remove that element from the array completely, white space and all? When you remove an element and the white space, the array size should decrease. Now if you do a array.length(), will it recognize the new size? TIA.
kevin
I don't know what white space has to do with arrays, I suppose it depends on what you're storing in the array. Anyway, an array is always a fixed length. You can replace one element with another, or set the value to null, but you can't just eliminate it. Also, there is no array.length() method, instaed you can refer to the array.length as a variable.
If you're dealing with a dynamically changing collection of Objects, perhaps ArrayList is a more appropriate data structure than array.
Bill