Search:

Type: Posts; User: Cornix

Search: Search took 0.08 seconds.

  1. Replies
    9
    Views
    2,152

    [SOLVED] Re: ArrayList.remove() problem. (solved)

    I was thinking about something like this:

    public static class Person {
    private String name;
    private int id;

    public Person(String name, int id) {
    this.name = name;
    this.id =...
  2. Replies
    9
    Views
    2,152

    [SOLVED] Re: ArrayList.remove() problem. (solved)

    The remove method uses the "equals(Object)" method of your objects. You can overwrite the equals method to check for equality with strings. If you do, you do not need to iterate over the entries and...
  3. Replies
    9
    Views
    2,152

    [SOLVED] Re: ArrayList.remove() problem.

    Your list contains elements of type "Person" but what you are trying to remove is an element of type "String".
    Since the list does not contain any strings it can not remove them either.
Results 1 to 3 of 3