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

How an object is serialized in java?

681


What are invisible components?.

1820


Difference between final and effectively final ? Why is effectively final even required ?

700


Why is java multithreaded?

680


How do you create an array in java?

687






What is the difference between throw and throws keywords?

727


Where are variables stored?

696


What are static methods?

742


What does @param args mean in java?

730


How is java hashmap implemented?

710


Explain different ways of creating a thread?

685


Difference between association, composition and aggregation?

694


What is null data type?

654


How do you sing an Applet ?

2185


What is widening and narrowing in java? Discuss with an example.

697