Diffrence between arraylist and hashmap

Answers were Sorted based on User's Feedback



Diffrence between arraylist and hashmap..

Answer / srikanth

arraylist is used for storing collection of elements with
duplicates
they can store only keys
it is extending list interface

hashmap
--------
hashmap is used for storing collection of elements with key
value pair without duplicates in unordered way

it is extending map interface

Is This Answer Correct ?    6 Yes 0 No

Diffrence between arraylist and hashmap..

Answer / srikanth

Arraylist is an ordered collection.of objects
they store their elements in index.rotation
Duplicate values are also allowed.
they show their elements in order ie... added order

But in hashmap is also ordered collection but don't contain
duplicate values.
Hashmap use key value for any object access.
hashmap allow null values

Is This Answer Correct ?    3 Yes 2 No

Diffrence between arraylist and hashmap..

Answer / billuyadav208

Arraylist is an ordered collection.
User access elements by their interger index.
Duplicate values are also allowed.
But in hashmap is also ordered collection but don't contain
duplicate values.
Hashmap use key value for any object access.

Is This Answer Correct ?    4 Yes 4 No

Post New Answer

More J2EE Interview Questions

Is java a high level language?

0 Answers  


What does j2ee stand for?

0 Answers  


what is the difference between Tomcat 4 & Tomcat 5?

6 Answers   IBM, TCS,


Why java is called portable language?

0 Answers  


What is setbounds in java?

0 Answers  






What is actionerrors?

0 Answers  


What do you mean by the component contract?

0 Answers  


What is enterprise information system?

0 Answers  


What is build file?

0 Answers  


which method does it invokes automatically when we click link in the webpage a)put b)get c)head d)post

7 Answers  


What is declaration?

0 Answers  


What are the advantages of object-relational mapping (orm)?

0 Answers  


Categories