when to use ArrayList and when to use HashMap in
webApplication.
Answer Posted / naseer
When you want to retrieve use ArrayList
Dont use ArrayList if the frequent operation is insertion
and deletion instead use LinkedList.
Use HashMap if you want to store interms of Key and Value
pair .
Don’t use a HashMap unless you need the lookup feature. It
takes more time to build a HashMap than an ArrayList.
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is deserialization?
Can size_t be negative?
What are bind parameters?
Can we use catch statement for checked exceptions?
What are filterstreams?
Explain the purpose of garbage collection in Java?
What is the length of a string?
what invokes a threads run() method? : Java thread
What is the size of int?
What is return data type?
Can singleton class be serialized?
What is the meaning of flag day?
What does math floor () do?
Why is an interface be able to extend more than one interface but a class can’t extend more than one class?
What is a boolean field?