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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many types of classes are there in java?

511


What is the declaration statement?

502


Why 1 is not a prime number?

541


What are adapter classes?

596


Can a class be private or protected in java?

542






Explain an intermediate language?

503


What is an empty string in css?

518


What are thread groups?

566


What do you understand by the term singleton?

573


What do you understand by java?

555


What are the types of strings?

553


How do you use equal in java?

540


What are multiple inheritances?

573


Can we force the garbage collection to run?

529


Explain creating threads by extending thread class ?

571