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

How do you check if two strings are equal in java?

0 Answers  


Can a static block throw exception?

0 Answers  


Is java type safe?

0 Answers  


Why charat is used in java?

0 Answers  


Can you explain the Java thread lifecycle?

1 Answers  


What are the different types of garbage collectors in java?

0 Answers  


What is the difference between a Window and a Frame?

6 Answers   Infosys, ProKarma,


Can you override a private or static method in java?

1 Answers  


How many types of memory areas are allocated by jvm?

0 Answers  


where can we get jAVA project orientation traing in HYDERABD

0 Answers  


Is java still necessary?

0 Answers  


What are keywords and reserved words in java?

0 Answers  


Categories