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
How would you dynamically allocate memory to an array?
What causes memory leaks in java?
when a request is generated from apache tomcat 5.5 and goes to oracle 10g or mysql,,, how the oracle or mysql reads the request as apache is a web server and oracle 10g is application server? when the oracle 10g provides response, how the apche tomcat reads it???
What are the difference between composition and inheritance in java?
Tell some latest versions in JAVA related areas?
What is unicode full form?
How can I become a good programmer?
How to change the priority of thread or how to set priority of thread?
What is e in java?
How do you use equal in java?
Can we declare a class as static?
Which is easier .net or java?
What restrictions are placed on method overriding in java programming?
What is string in java?
How many bits are used to represent unicode, ascii, utf-16, and utf-8 characters?