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
Explain about instanceof operator in java?
Explain the difference between an Interface and an Abstract class?
What is square root in java?
What are thread groups?
What is array and arraylist in java?
Explain the significance of class loaders in bootstrap?
What happens if an exception is not handled in a program?
Where will it be used?
How do you sort objects in java?
What is Enum in Java?
What is method overloading in java ?
What are internal and external variables?
Explain heap sort?
What is a static method in java?
Differentiate storage classes on the basis of their scope?