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
How an object is serialized in java?
What are invisible components?.
Difference between final and effectively final ? Why is effectively final even required ?
Why is java multithreaded?
How do you create an array in java?
What is the difference between throw and throws keywords?
Where are variables stored?
What are static methods?
What does @param args mean in java?
How is java hashmap implemented?
Explain different ways of creating a thread?
Difference between association, composition and aggregation?
What is null data type?
How do you sing an Applet ?
What is widening and narrowing in java? Discuss with an example.