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
How do you break a loop?
Hi all, I am dng a mini project on FileSplitter application which splits the GBs of logfile into Smaller chunks(mbs) depending on the split size." How to handle GBs file? I am getting OutOfMemoryException, when I input such GB sized file. Thx
What do you mean by mnemonics?
What is the use of pattern in java?
What is OOP Language?
What are streams in java 8?
What are different types of constants?
What are java packages? What is the significance of packages?
What is an immutable object?
What is java console application?
How will you get the platform dependent values like line separator, path separator, etc., ?
What is string [] java?
what is deadlock? : Java thread
What is a text string?
Can we have try without catch block?