I have an ArrayList in Java, which contains Objects, these Objects are made of a string name and a number.
I want to check if any of the Objects is twice in the list and then update the number of one of them, afterwards delete the other one, so it wont get counted another time.
I already know how it works, but i have a big problem, both methodes, "contains" and "remove" do not work with the objects i want to work with. For expamle i want to remove the first object which contains the name XXXX, it wont remove the thing at all. It seems like these two methods are not made for selfmade Objects.
Is there a way of overriding the remove and contains method ? Eclipse does not help here with the autogenerated stuff.
btw: i have defiened an own "equals" method for the objects in my list which is working without any problems ( i always thought the arraylist methods would make use of the object methods )..
thanks.