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
We are seeing so many videos/audios as many web sited. But question is these videos or audios are stored in Databases ( Oracle, Mysql, Sybase,... ) or stored any file directory from there they will give the link for that? Pls explain and give sample code to achieve this one? Thanks, Seenu.
What is meant by call by reference?
Can interface be private in java?
Difference between concurrent hashmap and hashtable and collections
What do you mean by buffering?
How many types of gc are there in java?
How many days will it take to learn java?
What is meant by object?
What is java instanceof operator?
Does sprintf allocate memory?
What are the various access specifiers for java classes?
Explain the selection sort algorithm and state its time complexity?
Can we increase array size dynamically in java?
What is module in project?
What are scriptlets?