How do I remove an object from an ArrayList in Java?

后端 未结 9 1675
面向向阳花
面向向阳花 2020-12-15 01:06

I have an ArrayList that contains some object, such as User, and each object has a name and password property. How can I

9条回答
  •  渐次进展
    2020-12-15 01:34

    Just search through the ArrayList of objects you get from the user, and test for a name equal to the name you want to remove. Then remove that object from the list.

提交回复
热议问题