which one is performance wise advantageious from List,Set,Map?
Answers were Sorted based on User's Feedback
Answer / debapriya
See HasMap is used when u want to use key value pair
If u r storing Any Objects the better u write ur code for
hascode implementation ,the better the the retrieval process is
Set maintains order,each time u add a object ,it checks
whether it exists or not calling equals which in turn calls
the hashcode method(x.equals(y) means x.hashcode==y.hashcode)
List --->in case if u use Vector or ArrayList since both of
them implenets RandomAccessInterface so retrieval is faster
but addition or deletion is slower
LinkedList --->deletion or insertion is faster but does not
implemet RandomAccess interface
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / r.jainrocks@gmail.com
hi Debapriya,
can u send me some more info on collection...
i.e.
In which kind of application Set is better
In which kind of application Map is better
In which kind of application List is better
just named those kind of applications
thanks in advance...
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / pkj
List : storing of data is fast but retrieval is slow.
Map : Stroing of data is slow. But retrieval is slow.
Set : Stroing of data is slow. But retrieval is slow.
Depending on the req the collection can be used
| Is This Answer Correct ? | 1 Yes | 2 No |
what is difference between servletconfig and servletcontext?
How to eliminate duplicates from an array?
6 Answers ABC, AdMod, Adobe, College School Exams Tests, Patni, Wipro,
How to pass arraylist to stored procedure in java?
How many bytes is string in java?
What is collection class in java? List down its methods and interfaces.
What do you mean by an interface in java?
Which language is java?
How java enabled high performance?
How will you reverse a singly-link list?
0 Answers Akamai Technologies,
What is the difference between method overriding and overloading?
Explain the difference between string, stringbuffer and stringbuilder in java?
Have you ever used hashtable and dictionary?