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 internal implementation of set in java?
How do you create an array in java?
How can we access some class in another class in java?
What are locale settings?
What is fail first in java?
Is java an ide?
What interface is extended by awt event listeners?
Explain about complier design(phases)
Why do we use bufferedreader?
What is difference between an object and a class?
Which class is used by server applications to obtain a port and listen for client requests?
What is the purpose of encapsulation?
Is string is a keyword in java?
What is string english?
What is == in java?