Resize an array
Hi,
Is it possible to resize an array of objects ? I create an array of 10000 objets. But I need ,after more calculations , only 8000 objects. Is it possible to resize the original array without create another array and copy the original in the new array ?
Thank you for your help
Marcel
No, you cannot resize arrays in java.
The simplest thing to do is use one of the List implementations. ArrayList and LinkedList both provide
the appearence of resizable structures. (ArrayList contains an array which it automatically resizes for you
(by copying) which LinkedList is inherently dynamic in size (but slow to perform indexed get operations
on)
matfud