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
What is the purpose of the enableevents() method?
What is logical variable?
Which is dependent variable?
Give an example of call be reference significance.
Describe how to implement singleton design pattern in struts.
What sorting algorithm does javascript use?
What is the static block?
Difference between a class and an object?
What is charat ()?
What is the flag in java?
What is float in java?
What is the platform?
What checkbox method allows you to tell if a checkbox is checked?
I want to control database connections in my program and want that only one thread should be able to make database connection at a time. How can I implement this logic?
Explain the difference between extends thread vs implements runnable in java?