Answer Posted / sumit
set-->
when uniqueness is required you need to implement set.
e.g.
HashSet(unOrd,unSort) Fast access, assures no duplicates,
provides no ordering.
LinkedHashSet(Ord,unSort)No duplicates; iterates by
insertion order.
TreeSet(ascending,naturalord)No duplicates ; iterates in
sorted order.
list-->
when ordered list is required you need to implement list.
e.g.
ArrayList(Ord,unSort)Fast iteration and fast random access.
Vector(syncronized)
LinkedList()Good for adding elements to the ends, i.e.,
stacks and queues.
| Is This Answer Correct ? | 91 Yes | 7 No |
Post New Answer View All Answers
What are three advantages of using functions?
How does sublist works in java?
What happens if we don’t define serial version uid?
Can memory leak happen java?
What is the static method?
Explain about strings in java?
What is a function in programming?
What is the use of arraylist class in java?
What is meant by the value of a variable?
what is the volatile modifier for? : Java thread
What is immutable in java?
Is it possible to write a regular expression to check if string is a number?
What is nested loop? What is dangling else condition in it?
Which programming language is most secure?
What is externalizable interface?