#Removing object from arrayList if name.equals()
15 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @deft vortex! Please use
/closeor theClose Postbutton above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
you're not using it right
removeIf takes a predicate that takes the type of element in the arraylist, returns true if it should be removed and false if not
how does your code look
the method looks like this
I saw someone using the removeIf to check if n > 10 so I tried it also with my case
you dont need that loop around it
just have the removeIf there and it should be fine
putting a loop around it will cause it to crash because you're modifying the list as you iterate over it
which ArrayList does not like
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.