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
Why heap memory is called heap?
What is the use of pattern in java?
Write a method to check if input string is palindrome?
What do you understand by an io stream?
What is the intersection and union methods?
What do you mean by byte code?
What is main string [] args?
Which container method is used to cause a container to be laid out and redisplayed in java programming?
If an object is garbage collected, can it become reachable again?
In the below example, how many string objects are created?
What is the difference between object oriented programming language and object based programming language?
What is thread pool in java with example?
Can we use different return types for methods when overridden?
what is use of functional interface in java 8?
Where we write javascript code in html page?