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

What are the restrictions imposed on method overriding?

0 Answers  


What is the difference between the size and capacity of a vector?

0 Answers  


What is split return?

0 Answers  


what is the difference between HashMap And HashTable?

5 Answers   Hexaware,


My application URL : http://localhost:8080/Application/Login.jsp. When a user enter this url in IE then, how it get Login.JSP Page exactly? what are the processes will happen from when we submit the URL to get Login.jsp?

3 Answers   IBM, TCS,






What is polymorphism in java? What are the kinds of polymorphism?

0 Answers  


What is the difference between equals() and == in java?

0 Answers  


What is final, finally, finalize?

0 Answers  


What does it mean that a method or field is “static”?

0 Answers  


What is the exact difference in between Unicast and Multicast object ?

4 Answers   Accenture,


Why are variables important in research?

0 Answers  


Can we access the non-final local variable, inside the local inner class?

0 Answers  


Categories