Online Hibernate Training just in Rs. 1000

One week online training in Hibernate ORM framework. Learn Hibernate Framework and enhance your skills. Best Online Hibernate training at 90% discount. Join Now!! Offer is valid Only for limited Period!!! Online Training Big Data and Hadoop Training Java Training  
 

when to use ArrayList and when to use HashMap

Ads

 
 

Share on Google+Share on Google+

Rajendra
when to use ArrayList and when to use HashMap
1 Answer(s)      7 years ago
Posted in : Java Interview Questions
Ads
View Answers

October 2, 2009 at 12:25 PM


When your application demands saving the objects then ArrayList can be used. But if you need to retrieve the objects more often then HashMap is preferable.This is the basic diff. Aray-List is fast for storing and hashmap is fast for retrieving. If your application needs both storing and retrieving at same no. of times then u can Arraylist for storing and hashmap for the latter purpose.

Ads









Related Tutorials/Questions & Answers:
when to use ArrayList and when to use HashMap - Java Interview Questions
when to use ArrayList and when to use HashMap  when to use ArrayList and when to use HashMap in web applications . Thanks Prakash  When... can Arraylist for storing and hashmap for the latter purpose
Example for when to use ArrayList and when to use HashMap - Java Interview Questions
Example for when to use ArrayList and when to use HashMap  Hi Deepak u have replied this answer for when to use arraylist and hashmap " When your... Arraylist for storing and hashmap for the latter purpose. " Can you give
Advertisements
.When to use detached criteria in hibernate?
.When to use detached criteria in hibernate?  When to use detached criteria in hibernate?   Detached Criteria query is a facility provide by Hibernate to write criteria queries in detached mode, where hibernate session
When would you use the Builder Pattern?
When would you use the Builder Pattern?  When would you use the Builder Pattern
When would you use the Builder Pattern?
When would you use the Builder Pattern?  When would you use the Builder Pattern
When should you use Hibernate?
When should you use Hibernate in Java Project? Hibernate is ORM framework... number of database. You can use Oracle, MySQL, DB2 and any of supported databases with Hibernate. In this article we are discussing when developer should use
When are you supposed to use endif to end the conditional statement?
When are you supposed to use endif to end the conditional statement?  When are you supposed to use endif to end the conditional statement
get UnsatisfiedLinkError when I try to use my JDBC driver.
get UnsatisfiedLinkError when I try to use my JDBC driver.  Why do I get UnsatisfiedLinkError when I try to use my JDBC driver
to use ArrayList in the place of Vector
to use ArrayList in the place of Vector  public Enumeration getInterfaces() { ISCMetaType currentType = this; ArrayList allInterfaces = new ArrayList(); while( currentType != null
to use ArrayList in the place of Vector
to use ArrayList in the place of Vector  public Enumeration getInterfaces() { ISCMetaType currentType = this; ArrayList allInterfaces = new ArrayList(); while( currentType != null
JSP JSTL c:when tag
JSP JSTL c:when tag          In this section, you will learn how to use the jstl when tag in jsp. Basically, the choose, when, and otherwise tags can
How to use Arraylist object in <s:dobleselect> .... struts 2? - Struts
How to use Arraylist object in .... struts 2?  Hi Members, I saw the example of tag in roseindia, its very useful. But I have to use my ArrayList object with that tag. Im retrieving the values for arraylist object from
How to obtain the selected data item from a list box when listbox contains objects wrapped under Arraylist?
How to obtain the selected data item from a list box when listbox contains objects wrapped under Arraylist?  I have a jsp page containing a list box... page. The listbox gets populated by the data contained in the arraylist. Now, I
Jstl c:when,c:choose,c:otherwise tag in jsp
JSTL c:when,c:choose,c:otherwise TAGS IN JSP In this Section, we will discuss about how to use JSTL tag ' c:when ' in JSP with a simple example. Basically, the choose, when, and otherwise tags are used to construct an "c
hashmap
hashmap  write a program that shows the use of Hashmap class
Any Link Between ArrayList and HashMap - Java Interview Questions
interview questions which relates ArrayList and Hashmap. I mean how to link ArrayList and HashMap. Thanks Prakash  Hi Friend, Similarities: 1)ArrayList and HashMap both have a capacity. 2)Both are not synchronized. 3)Both
Java HashMap iterator and example
Java HashMap Iterator is an interface. It keeps the data in the key and value form. It is implemented by HashMap. hashMap doesnot have iterator method. So use the entrySet() method to get the data in Set object form. Set's all
the use of ForwardAction
the use of ForwardAction  What is the use of ForwardAction
use forms.
use forms.  How do I use forms
Use of <x:choose> tag of JSTL
Use of <x:choose> tag of JSTL       In this section we will learn how to use <x...; <x:when select="$emp
use of annotation.
use of annotation.  for concurrency which annotation can be used
use is of 2
use is of 2  why we use 2 in "Integer.parseInt(str,2);" for binary to decimal conversion..??   ya i got it... because binary contain only two o and 1...so here use 2...same as octal has 8
Use of jQuery
Use of jQuery  What is the use of jQuery?   Hi, jQuery is JavaScript Ajax library. Developer is using it to create rich internet applications. Read at jQuery Tutorial. Thanks
Java Hashmap Iterator
Java HashMap Iterator is a collection class. It implements the Map interface. It keeps the data in the key and value form. Java HashMap has no iterator method. So use the entrySet() method.It returns the data in Set object form
use of package concepts
use of package concepts  i m getting error when i use .* method to access all package files. when i use this through another method like... want to use packagename.* methhod. please solve the problem. i just start
when will we get JasperException and parseException?
when will we get JasperException and parseException?  when will we get JasperException and parseException
When will you define a method as static?
When will you define a method as static?  Hi, When will you define a method as static? thanks
use of jquery
use of jquery  what is a jquery? what is the evalution of jquery?   Hello Friend, Please visit the following link: JQuery Tutorials Thanks
how to use a session.removeAttribute - JSP-Servlet
how to use a session.removeAttribute  Dear Sir, I am... to send a mail to all employees when i upload a file.I am storing a different matters in a arraylist,and that arrylist am storing in a session.My probs
use of splitpane
use of splitpane  using JSplitPane split pane in three part. 1st in textField 2nd label and 3rd description. in textField we enter the primary key in textField than it show its all two part as label(image) and description of user
Java Hashmap Sorting - Java Beginners
Java Hashmap Sorting   I have a sorting issue with a Hashmap. My constraint is that I MUST use the Hashmap and work with existing code. I do a database query and place the results in a Hashmap. When I iterate thru the Hashmap