How to eliminate duplicates from an array?

Answer Posted / edward sudhaharchennai

Unlike other implementations of the collection interface,
implementation of the Set intrface do not allow duplicate
elements. This also means that a set can contain at most
one null value. The set interface does not define any new
methods, and its add() and addAll() methods will not store
duplicates. If an element is not currently in the set, two
consecutive calls to the add() method to insert the element
will first return true then false...........

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why heap memory is called heap?

771


What is the use of pattern in java?

770


Write a method to check if input string is palindrome?

769


What do you understand by an io stream?

795


What is the intersection and union methods?

777


What do you mean by byte code?

740


What is main string [] args?

735


Which container method is used to cause a container to be laid out and redisplayed in java programming?

843


If an object is garbage collected, can it become reachable again?

770


In the below example, how many string objects are created?

772


What is the difference between object oriented programming language and object based programming language?

754


What is thread pool in java with example?

736


Can we use different return types for methods when overridden?

764


what is use of functional interface in java 8?

782


Where we write javascript code in html page?

800