Which class has no duplicate elements?
Answers were Sorted based on User's Feedback
Answer / ranganathkini
The java.util.Set interface and related implementations dont
support duplicate elements.
| Is This Answer Correct ? | 13 Yes | 0 No |
Answer / ramanareddy333
in java .util package there is one interface (set interface)
that interface does not allows the duplicate values.that
interface implementations class are
hashset,treeset....these classes don't allow the duplicate
values.
| Is This Answer Correct ? | 9 Yes | 1 No |
Answer / shweta
set wont allow duplicate element all the classes implementin
set interface wont allow for eg HashSet TreeSet
Hash map will allow for two different key u can have same value
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / neeti
the set inteface does'nt allow duplicate
elements.therefore,the add() method return false if an
attempt is made to add duplicate elements to a set.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / venkatesh
Which one will not allow duplicates, is it HashMap or
HashTable? Please explain the corect answer with an
example. Thanks in advance
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / rajesh
hashset,treeset....these classes don't allow the duplicate
values.
| Is This Answer Correct ? | 2 Yes | 2 No |
Have you used any version control ? if so explain about it?
what is Vector class?
What is unmodifiable collection in java?
When do you create an index?
What does the “static” keyword mean?
What are the advantages and disadvantages of reference counting in garbage collection?
Explain reverse a linked list recursive java solution?
What is the effect of keeping a constructor private?
What is the instance of an object?
suppose in a class there is a code like this: { Set hs=new Hashset(); hs.add(new Emp("kathy",1000)); hs.add(new Emp("kathy",2000)); } how can u avoid the above code in your class as set won't allow duplicate objects?
Write a java program to print fibonacci series?
Features of Java?