which one is performance wise advantageious from List,Set,Map?

Answers were Sorted based on User's Feedback



which one is performance wise advantageious from List,Set,Map?..

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

which one is performance wise advantageious from List,Set,Map?..

Answer / prashanth

list

Is This Answer Correct ?    2 Yes 0 No

which one is performance wise advantageious from List,Set,Map?..

Answer / kamala

MAP

Is This Answer Correct ?    2 Yes 0 No

which one is performance wise advantageious from List,Set,Map?..

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

which one is performance wise advantageious from List,Set,Map?..

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

which one is performance wise advantageious from List,Set,Map?..

Answer / anand

set

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More Core Java Interview Questions

We are seeing so many videos/audios as many web sited. But question is these videos or audios are stored in Databases ( Oracle, Mysql, Sybase,... ) or stored any file directory from there they will give the link for that? Pls explain and give sample code to achieve this one? Thanks, Seenu.

0 Answers   Symphony,


What do u mean by wrapper Class? What do u mean by Jvm... How do u change JVM for other OS? Or No need to Change ...? its like tricky

6 Answers   Accenture, EDS,


Does java support function overloading, pointers, structures, unions or linked lists?

0 Answers  


define polymorphism in java

0 Answers  


what do you mean by marker interface in java?

0 Answers  






Can you access non static variable in static context?

0 Answers  


How can I debug the Java security exceptions and AccessControlExceptions?

0 Answers   IBM,


What is the difference between overriding and overloading in OOPS.

0 Answers   Axtria, ITC Indian Tobacco Company,


What is aggregation and composition ?

1 Answers   Fidelity,


How many types of constructors are used in java?

0 Answers  


what is the diffrences between platform independent and portable

5 Answers   TCS,


Can you tell me range of byte?

0 Answers  


Categories