Omit duplicate object that has same value in a collection class
Set is able to omit duplicate value.
But, let say an object carry two attributes: attribute 1 and attribute2 and later it is added to a collection class.
Is anyone of you able to omit the object with same attribute 1 and attribute2?
Object obj1 = new Object();
obj1.attribute1 = "abc";
obj1.attribute2 = "def";
Object obj2 = new Object();
obj2.attribute1 = "abc";
obj2.attribute2 = "def";
Here, I hope the collection variable would carry one obj only instead of 2 obj...
Re: Omit duplicate object that has same value in a collection class
Crossposted at OTN...don't have the link handy I'm afraid.
There's a few answers over there, so no point anyone here looking at this I suppose.