| Author |
removing an object from an array
|
Carie Herrick
Greenhorn
Joined: Sep 26, 2008
Posts: 16
|
|
I have 6 objects in my array which are filled with various data... I am tasked with "removing an object from an array by either shifting remaining objects to the start of the array, or putting the last object into the slot where the deleted object used to be." I know the index # of the array object that needs to be removed. After removed, I still have to call my array to look for the other objects. Does this make sense to anyone and if so, any suggestions on how to attempt this? Thanks!
|
 |
Steve Luke
Bartender
Joined: Jan 28, 2003
Posts: 3032
|
|
|
So you have two proposed methods of removing the object from an array. Which one do you want to use? Pick one. Then try to implement it and when you find a problem show us your work and we can help you fix it.
|
Steve
|
 |
Carie Herrick
Greenhorn
Joined: Sep 26, 2008
Posts: 16
|
|
|
I don't know which one to use because I don't know how to implement either one. After researching, I found just to set the array index to null. Hoping this will work...
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56183
|
|
|
"Carie", please check your private messages for an important administrative matter.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Gamini Sirisena
Ranch Hand
Joined: Aug 05, 2008
Posts: 347
|
|
|
See if this helps.
|
 |
 |
|
|
subject: removing an object from an array
|
|
|