I have an array which looks like this:
array = { Person1, Person2, Person3, Person1, Person2, Person3};
Now how can I get an int with the total count of unique Persons? That means a Person which was already counted, shouldn't be counted again.
In the give example above should return the int value of 3
int uniq = 3;
How can I do this task?
array[0] == array[3]would be true, in the above example)? Or have you redefinedequalsfor yourPersonclass? Or are you using some other method to test whether two persons are the same?