when to use ArrayList and when to use HashMap in
webApplication.



when to use ArrayList and when to use HashMap in webApplication...

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

More Core Java Interview Questions

Why null interfaces are used in Java?

2 Answers  


Explain when noclassdeffounderror will be raised ?

0 Answers  


What is a method in coding?

0 Answers  


What is jit compiler in java?

0 Answers  


What is the difference between choice and list?

0 Answers  






which method throws exception of type Throwable

2 Answers  


Differences between external iteration and internal iteration?

0 Answers  


What is an class?

0 Answers  


what is the purpose of using rmisecuritymanager in rmi?

0 Answers  


How does compareto work in java?

0 Answers  


What is the significance of continue jump statement? Explain with an example.

0 Answers   Amdocs,


What is java autoboxing?

0 Answers  


Categories