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 to make object serializable in java?

540


What is equlas() and hashcode() contract in java? Where does it used?

602


How will you add panel to a frame?

640


difference between byte stream class and character stream class?

4080


What is the memory leak in java?

522






What is the function of static in java?

537


What is method in java with example?

485


How do constructors use this() and super()?

542


What is the default value of byte datatype in java?

478


Can java list be null?

545


What is replacefirst in java?

567


What does replaceall do in java?

484


What is a nonetype?

559


What is garbage collection? Can it be forced to run?

539


Why main function is static?

665