--There are 10 elements in this array (0-9) right.
That's wrong, there's 9 elements, from 0 - 8
You don't need to expand the array, you can just use an ArrayList which will do it for you. With an arraylist, you can just add stuff to it, it will dynamically increase in size or decrease.
Dan [ February 04, 2006: Message edited by: Dani Atrei ]
Si altas son las torres, el valor es alto - Alberti
Ankur Sharma
Ranch Hand
Joined: Dec 27, 2005
Posts: 1234
posted
0
The above reply is fine otherwise you can create an array of that particular size and copy it by System.arrayCopy() which will copy the earlier array into new one.
The Best way to predict your future is to create it
Ankur Sharma