This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Removing Elements From an Array Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Removing Elements From an Array" Watch "Removing Elements From an Array" New topic
Author

Removing Elements From an Array

Landon Blake
Ranch Hand

Joined: Dec 04, 2003
Posts: 121
I need to know the proper syntax for removal of an element from a vector. Do I have this correct?
Example:
I have an object that contains a Vector of Strings named dataType.
I have an int variable named elementNumber that specifies the location of the element I want to remove.
Would I call the following method to remove the String Object?
dataType.remove(elementNumber)
Thanks,
Landon
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 9948
    
    6

from the API
remove
public Object remove(int index)
Removes the element at the specified position in this Vector. shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the Vector.


Never ascribe to malice that which can be adequately explained by stupidity.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Removing Elements From an Array
 
Similar Threads
The right collection
Proper Syntax For Removal From Vector
Regarding vector
Dynamic links
Couldn't view to panel