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 |
What is empty list in java?
I have one Shopping cart application, i that i have selected some items, while clicking submit button by mistake i have clicked twice or trice, that time items are selected twice or trice. Actually i want only one copy of items but its selected twice or trice. So how can we avoid this problem?
What is private static class in java?
while creating thread why we extend thread class
How to make a non daemon thread as daemon?
What is argument in java?
What is method overloading and method overriding?
What is nan in java?
Which is bigger float or double java?
How do you read a char in java?
What is a method in programming?
Package1 and Package2 both have a method name lets say "methodA" with different implementation. When I import both the packages in a java class how can I use both the methods?