How can eliminate dulicates from Array
How can eliminate duplicates from Array
How can eliminate duplicates from Array
What is an Array?
If you have a Collection, you can use the Set method addAll() to add them all to a Set. The resulting set will contain no duplicate elements.
If what you have is an array (small 'a'), then add the elements one at a time to a Set to obtain the same result.
The best solution is not to place duplicates in the array in the first place. That is, everytime you try to insert an element, check the array to see if it is already present.
Actually the best solution would be to use a Collection that doesn't allow duplicates such as a Set but I assume you have an assignment that specifies the use of an array.