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
Write a program to find the whether a number is an Armstrong number or not?
What are the problems faced by java programmers who don't use layout managers?
What does math floor () do?
What is a class variable?
What do you understand by garbage collection in Java? Can it be forced to run?
What is function and its uses?
What does java ide mean?
What happens if an exception is not handled in a program?
What is the implementation of destroy method in java. Is it native or java code?
What is meant by class loader? How many types are there? When will we use them?
Explain where variables are created in memory?
What is the exact difference in between Unicast and Multicast object? Where will it be used?
Why stringbuilder is not thread safe in java?
What is lazy initialization in java?
Why lambda expression is used in java?