Click here to Skip to main content
15,948,338 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi I wish to remove an int element from my int arraylist, I have tried .remove method but it does not work.

Example: [34, 0]

Remove the element 0 from the arraylist
Updated 20-Nov-14 19:36pm
Mathew Soji 21-Nov-14 1:49am    
Hello, post your code here for better results . People can't assume your code .

Share this answer
In order to remove a integer using the .remove method of the arraylist class you have to pass the index as a parameter. You can try .remove(.indexOf(0)). .indexOf(0) will return the index of 0.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900