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

What is commit?

0 Answers  


Which of the following are subclasses of java awt component?

0 Answers  


What is j2ee application model?

0 Answers  


What is declarative security ?

0 Answers  


What is container-managed sign-on?

0 Answers  






what is external varibles in jsp?

1 Answers   Verizon,


What is java 2 platform, micro edition (j2me)?

0 Answers  


for example we are login into the irctc server from there it will go to the selected bank and deduct amount and come back to the irctc. so if we are developing this in java means will it be run on the same session. but as per my knowledge bank is separate and irctc is separate URL's so it will use two different sessions then how it is maintaining same session through out application and even it uses the payment gateway? how it is working can any one help me on that??

0 Answers  


Why primitive data types in java are not objects?

0 Answers  


What do you understand by connector? Explain connector architecture.

0 Answers  


What spring is in related to j2ee?

0 Answers  


What is container-managed persistence?

0 Answers  


Categories