
-----------------------------------
Genisis
Thu Jun 15, 2006 8:57 pm

how do i delete a part of an array
-----------------------------------
dont know how to delete part of an array and one of the options of my program is that the use can choose to delete a record how do i do that?

-----------------------------------
Tony
Thu Jun 15, 2006 10:59 pm


-----------------------------------
Usually the record that needs to be deleted is swaped with the last record in the array, and then cut via reducing array's size by one.

-----------------------------------
wtd
Fri Jun 16, 2006 6:59 am


-----------------------------------
Your best bet if you need to do something like this is to use not an array at all, but rather one of Java's Collection classes.  Perhaps ArrayList.

-----------------------------------
gsquare567
Fri Jun 16, 2006 1:40 pm


-----------------------------------
yeah theres the ArrayList class and also the LinkedList class... they're quite similar but it depends on what you're doing if you want the better choice for you.
