Does Arraylist have an way to remove a piece data out the array once it has been added or do have create a new array list to move the data to a different array and not include the data I don't want in the array. I have been working on a program from school that keeps track of how many DVD's I have in an inventory. I have to add button to the program that deletes the dvd from the inventory and Arraylist is what I use to calculate the whole value of the but now I need to be able to remove the whole instance of any deleted dvd from the inventory so my inventory value will be right. Anyone have any good suggestions I could accomplish this.
Seems like I need to go back to the way I add the elements to the way I add the DVD's to the list to include an index or have to use the get index method then I could remove it by the index number of the element I want to remove. This way it will shift the array and - 1 from all indexes to left by one.
Actually, there's a [remove(Object)|http://java.sun.com/j2se/1.5.0/docs/api/java/util/ArrayList.html#remove(java.lang.Object)] method that will remove the object passed in. If you're adding objects of a class that you wrote, then you'll probably have to override the equals(Object) method in that class for the remove method to act appropriately.