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 is the syntax and characteristics of a lambda expression? Explain
What is the use of System class?
What are the main uses of the super keyword?
Why do we need array in java?
What the difference is between execute, execute Query, execute Update?
What is the importance of hashcode() and equals() methods?
What is parseint?
explain copyonwritearraylist and when do we use copyonwritearraylist?
What is unicode with example?
What is the purpose of the strictfp keyword?
What is type parameter in java?
what is meant by HQL?
whar are the draw backs of programming lang step by step in Clang and next in C++ and next and in Java nad in .Net
What does mean in regex?
Difference between arraylist and hashset in java?